aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-24 09:11:23 +0100
committerGitHub <noreply@github.com>2022-05-24 09:11:23 +0100
commitc83837e684347563c068c5ca4849090695bc97d0 (patch)
tree469de0d1be5d8a7beeed80b25c036e4d6c819aeb
parent20844942a8923752c7ec2ca1cbcd37b5c36de875 (diff)
Strip `join_authorised_by_users_server` when updating membership events using `/rooms/{roomID}/state` (#2482)
-rw-r--r--clientapi/routing/sendevent.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go
index 5f84739d..b8a7fe98 100644
--- a/clientapi/routing/sendevent.go
+++ b/clientapi/routing/sendevent.go
@@ -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{