Send state with new room events
This commit is contained in:
parent
9d6b77c58a
commit
2951eb20af
|
@ -339,12 +339,21 @@ func createRoom(
|
||||||
util.GetLogger(req.Context()).WithError(err).Error("authEvents.AddEvent failed")
|
util.GetLogger(req.Context()).WithError(err).Error("authEvents.AddEvent failed")
|
||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// send events to the room server
|
accumulated := gomatrixserverlib.UnwrapEventHeaders(builtEvents)
|
||||||
if err = roomserverAPI.SendEvents(req.Context(), rsAPI, builtEvents, cfg.Matrix.ServerName, nil); err != nil {
|
if err = roomserverAPI.SendEventWithState(
|
||||||
util.GetLogger(req.Context()).WithError(err).Error("SendEvents failed")
|
req.Context(),
|
||||||
return jsonerror.InternalServerError()
|
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
|
// TODO(#269): Reserve room alias while we create the room. This stops us
|
||||||
|
|
Loading…
Reference in a new issue