mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-25 13:11:37 +00:00
Send cumulative state when creating room (#1519)
* Send state with new room events * lookupEvent sends outliers * Revert "lookupEvent sends outliers" This reverts commit 3e1655644105a542b806e28d6d2536fbd23ecc83.
This commit is contained in:
parent
9d6b77c58a
commit
20aec70ead
@ -339,13 +339,22 @@ func createRoom(
|
||||
util.GetLogger(req.Context()).WithError(err).Error("authEvents.AddEvent failed")
|
||||
return jsonerror.InternalServerError()
|
||||
}
|
||||
}
|
||||
|
||||
// send events to the room server
|
||||
if err = roomserverAPI.SendEvents(req.Context(), rsAPI, builtEvents, cfg.Matrix.ServerName, nil); err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("SendEvents failed")
|
||||
accumulated := gomatrixserverlib.UnwrapEventHeaders(builtEvents)
|
||||
if err = roomserverAPI.SendEventWithState(
|
||||
req.Context(),
|
||||
rsAPI,
|
||||
&gomatrixserverlib.RespState{
|
||||
StateEvents: accumulated,
|
||||
AuthEvents: accumulated,
|
||||
},
|
||||
ev.Headered(roomVersion),
|
||||
nil,
|
||||
); err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("SendEventWithState failed")
|
||||
return jsonerror.InternalServerError()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(#269): Reserve room alias while we create the room. This stops us
|
||||
// from creating the room but still failing due to the alias having already
|
||||
|
Loading…
Reference in New Issue
Block a user