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,11 +125,12 @@ func SendMembership(
returnData = struct {
RoomID string `json:"room_id"`
}{roomID}
fallthrough
default:
}
_, err = producer.SendEvents(
req.Context(),
[]gomatrixserverlib.HeaderedEvent{(*event).Headered(verRes.RoomVersion)},
[]gomatrixserverlib.HeaderedEvent{event.Headered(verRes.RoomVersion)},
cfg.Matrix.ServerName,
nil,
)
@ -137,7 +138,6 @@ func SendMembership(
util.GetLogger(req.Context()).WithError(err).Error("producer.SendEvents failed")
return jsonerror.InternalServerError()
}
}
return util.JSONResponse{
Code: http.StatusOK,

View file

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