mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Send create room events as new
This commit is contained in:
parent
4253eccfb3
commit
75cfec95e2
1 changed files with 12 additions and 15 deletions
|
@ -452,21 +452,18 @@ func createRoom(
|
||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
}
|
}
|
||||||
|
|
||||||
accumulated := gomatrixserverlib.UnwrapEventHeaders(builtEvents)
|
inputs := make([]roomserverAPI.InputRoomEvent, 0, len(builtEvents))
|
||||||
if err = roomserverAPI.SendEventWithState(
|
for _, event := range builtEvents {
|
||||||
req.Context(),
|
inputs = append(inputs, roomserverAPI.InputRoomEvent{
|
||||||
rsAPI,
|
Kind: roomserverAPI.KindNew,
|
||||||
roomserverAPI.KindNew,
|
Event: event,
|
||||||
&gomatrixserverlib.RespState{
|
Origin: cfg.Matrix.ServerName,
|
||||||
StateEvents: accumulated,
|
AuthEventIDs: event.AuthEventIDs(),
|
||||||
AuthEvents: accumulated,
|
SendAsServer: roomserverAPI.DoNotSendToOtherServers,
|
||||||
},
|
})
|
||||||
ev.Headered(roomVersion),
|
}
|
||||||
cfg.Matrix.ServerName,
|
if err = roomserverAPI.SendInputRoomEvents(req.Context(), rsAPI, inputs, false); err != nil {
|
||||||
nil,
|
util.GetLogger(req.Context()).WithError(err).Error("roomserverAPI.SendInputRoomEvents failed")
|
||||||
false,
|
|
||||||
); err != nil {
|
|
||||||
util.GetLogger(req.Context()).WithError(err).Error("SendEventWithState failed")
|
|
||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue