From 71b4aeb639609ecce1d87c69adef2e3f2d20e19e Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Tue, 22 Feb 2022 18:11:18 +0100 Subject: [PATCH] Set powerlevel.invite to 0 --- clientapi/routing/createroom.go | 7 +++++++ sytest-blacklist | 1 - sytest-whitelist | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/clientapi/routing/createroom.go b/clientapi/routing/createroom.go index fcacc76c0..420a66609 100644 --- a/clientapi/routing/createroom.go +++ b/clientapi/routing/createroom.go @@ -227,6 +227,13 @@ func createRoom( HistoryVisibility: historyVisibilityShared, } + // NOTSPEC: The powerlevel for invite should be set to 50, according to the spec, but synapse sets it to 0 for invite. + // https://github.com/matrix-org/synapse/blob/6d14b3dabfe38c6ae487d0f663e294056b6cc056/synapse/handlers/room.py#L120-L133 + isPrivateChat := r.Preset == presetPrivateChat || r.Preset == presetTrustedPrivateChat + if r.PowerLevelContentOverride == nil && isPrivateChat { + r.PowerLevelContentOverride = []byte(`{ "invite": 0 }`) + } + if r.PowerLevelContentOverride != nil { // Merge powerLevelContentOverride fields by unmarshalling it atop the defaults err = json.Unmarshal(r.PowerLevelContentOverride, &powerLevelContent) diff --git a/sytest-blacklist b/sytest-blacklist index 16abce8da..23a1c2561 100644 --- a/sytest-blacklist +++ b/sytest-blacklist @@ -14,7 +14,6 @@ The only membership state included in a gapped incremental sync is for senders i # Blacklisted out of flakiness after #1479 Invited user can reject local invite after originator leaves Invited user can reject invite for empty room -If user leaves room, remote user changes device and rejoins we see update in /sync and /keys/changes # Blacklisted due to flakiness Forgotten room messages cannot be paginated diff --git a/sytest-whitelist b/sytest-whitelist index d3144572d..5da98418b 100644 --- a/sytest-whitelist +++ b/sytest-whitelist @@ -601,3 +601,4 @@ Can query remote device keys using POST after notification Device deletion propagates over federation Get left notifs in sync and /keys/changes when other user leaves Remote banned user is kicked and may not rejoin until unbanned +If user leaves room, remote user changes device and rejoins we see update in /sync and /keys/changes