Send the invite event as a normal roomserver event too, for incorporating into room (should this be done by the roomserver automatically for invite inputs?)

This commit is contained in:
Neil Alexander 2020-04-24 11:53:53 +01:00
parent cf024e7914
commit cb4151e72c
2 changed files with 12 additions and 12 deletions

View file

@ -125,18 +125,18 @@ func SendMembership(
returnData = struct { returnData = struct {
RoomID string `json:"room_id"` RoomID string `json:"room_id"`
}{roomID} }{roomID}
fallthrough
default: default:
_, err = producer.SendEvents( }
req.Context(),
[]gomatrixserverlib.HeaderedEvent{(*event).Headered(verRes.RoomVersion)}, _, err = producer.SendEvents(
cfg.Matrix.ServerName, req.Context(),
nil, []gomatrixserverlib.HeaderedEvent{event.Headered(verRes.RoomVersion)},
) cfg.Matrix.ServerName,
if err != nil { nil,
util.GetLogger(req.Context()).WithError(err).Error("producer.SendEvents failed") )
return jsonerror.InternalServerError() if err != nil {
} util.GetLogger(req.Context()).WithError(err).Error("producer.SendEvents failed")
return jsonerror.InternalServerError()
} }
return util.JSONResponse{ return util.JSONResponse{

View file

@ -143,7 +143,7 @@ func updateToInviteMembership(
// consider a single stream of events when determining whether a user // consider a single stream of events when determining whether a user
// is invited, rather than having to combine multiple streams themselves. // is invited, rather than having to combine multiple streams themselves.
onie := api.OutputNewInviteEvent{ onie := api.OutputNewInviteEvent{
Event: (*add).Headered(roomVersion), Event: add.Headered(roomVersion),
RoomVersion: roomVersion, RoomVersion: roomVersion,
} }
updates = append(updates, api.OutputEvent{ updates = append(updates, api.OutputEvent{