0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-06-21 05:48:22 +02:00

Send cumulative state when creating room (#1519)

* Send state with new room events

* lookupEvent sends outliers

* Revert "lookupEvent sends outliers"

This reverts commit 3e16556441.
This commit is contained in:
Neil Alexander 2020-10-14 09:57:27 +01:00 committed by GitHub
parent 9d6b77c58a
commit 20aec70ead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,12 +339,21 @@ 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")
return jsonerror.InternalServerError()
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