mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Merge branch 'master' into neilalexander/federationinput
This commit is contained in:
commit
ad19c2b81a
79 changed files with 1351 additions and 1714 deletions
|
@ -194,6 +194,12 @@ func SendJoin(
|
|||
JSON: jsonerror.BadJSON("No state key was provided in the join event."),
|
||||
}
|
||||
}
|
||||
if !event.StateKeyEquals(event.Sender()) {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.BadJSON("Event state key must match the event sender."),
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the room ID is correct.
|
||||
if event.RoomID() != roomID {
|
||||
|
|
|
@ -175,10 +175,16 @@ func SendLeave(
|
|||
}
|
||||
}
|
||||
|
||||
if event.StateKey() == nil {
|
||||
if event.StateKey() == nil || event.StateKeyEquals("") {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.InvalidArgumentValue("missing state_key"),
|
||||
JSON: jsonerror.BadJSON("No state key was provided in the leave event."),
|
||||
}
|
||||
}
|
||||
if !event.StateKeyEquals(event.Sender()) {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.BadJSON("Event state key must match the event sender."),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
|
|||
for _, task := range tasks {
|
||||
if task.err != nil {
|
||||
results[task.event.EventID()] = gomatrixserverlib.PDUResult{
|
||||
Error: task.err.Error(),
|
||||
// Error: task.err.Error(), TODO: this upsets tests if uncommented
|
||||
}
|
||||
} else {
|
||||
results[task.event.EventID()] = gomatrixserverlib.PDUResult{}
|
||||
|
@ -611,5 +611,6 @@ func (t *txnReq) processEvent(_ context.Context, e *gomatrixserverlib.HeaderedEv
|
|||
t.Origin,
|
||||
api.DoNotSendToOtherServers,
|
||||
nil,
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ func CreateInvitesFrom3PIDInvites(
|
|||
}
|
||||
|
||||
// Send all the events
|
||||
if err := api.SendEvents(req.Context(), rsAPI, api.KindNew, evs, "TODO", cfg.Matrix.ServerName, nil); err != nil {
|
||||
if err := api.SendEvents(req.Context(), rsAPI, api.KindNew, evs, "TODO", cfg.Matrix.ServerName, nil, false); err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("SendEvents failed")
|
||||
return jsonerror.InternalServerError()
|
||||
}
|
||||
|
@ -181,6 +181,7 @@ func ExchangeThirdPartyInvite(
|
|||
request.Origin(),
|
||||
cfg.Matrix.ServerName,
|
||||
nil,
|
||||
false,
|
||||
); err != nil {
|
||||
util.GetLogger(httpReq.Context()).WithError(err).Error("SendEvents failed")
|
||||
return jsonerror.InternalServerError()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue