Strip join_authorised_by_users_server when updating membership events using /rooms/{roomID}/state

This commit is contained in:
Neil Alexander 2022-05-23 18:03:31 +01:00
parent 4472267901
commit b2674047fe
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -104,6 +104,13 @@ func SendEvent(
return *resErr
}
// If we're sending a membership update, make sure to strip the authorised
// via key if it is present, otherwise other servers won't be able to auth
// the event if the room is set to the "restricted" join rule.
if eventType == gomatrixserverlib.MRoomMember {
delete(r, "join_authorised_by_users_server")
}
evTime, err := httputil.ParseTSParam(req)
if err != nil {
return util.JSONResponse{