Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit cc9a6f7

Browse files
committed
Update constant name now that MSC3083 is merged.
1 parent ee762af commit cc9a6f7

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

synapse/api/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class JoinRules:
6262
INVITE = "invite"
6363
PRIVATE = "private"
6464
# As defined for MSC3083.
65-
MSC3083_RESTRICTED = "restricted"
65+
RESTRICTED = "restricted"
6666

6767

6868
class RestrictedJoinRuleTypes:

synapse/event_auth.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,7 @@ def _is_membership_change_allowed(
370370
raise AuthError(403, "You are banned from this room")
371371
elif join_rule == JoinRules.PUBLIC:
372372
pass
373-
elif (
374-
room_version.msc3083_join_rules
375-
and join_rule == JoinRules.MSC3083_RESTRICTED
376-
):
373+
elif room_version.msc3083_join_rules and join_rule == JoinRules.RESTRICTED:
377374
# This is the same as public, but the event must contain a reference
378375
# to the server who authorised the join. If the event does not contain
379376
# the proper content it is rejected.

synapse/handlers/event_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ async def has_restricted_join_rules(
240240

241241
# If the join rule is not restricted, this doesn't apply.
242242
join_rules_event = await self._store.get_event(join_rules_event_id)
243-
return join_rules_event.content.get("join_rule") == JoinRules.MSC3083_RESTRICTED
243+
return join_rules_event.content.get("join_rule") == JoinRules.RESTRICTED
244244

245245
async def get_rooms_that_allow_join(
246246
self, state_ids: StateMap[str]

tests/handlers/test_space_summary.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,12 @@ def test_filtering(self):
231231
invited_room = self._create_room_with_join_rule(JoinRules.INVITE)
232232
self.helper.invite(invited_room, targ=user2, tok=self.token)
233233
restricted_room = self._create_room_with_join_rule(
234-
JoinRules.MSC3083_RESTRICTED,
234+
JoinRules.RESTRICTED,
235235
room_version=RoomVersions.V8.identifier,
236236
allow=[],
237237
)
238238
restricted_accessible_room = self._create_room_with_join_rule(
239-
JoinRules.MSC3083_RESTRICTED,
239+
JoinRules.RESTRICTED,
240240
room_version=RoomVersions.V8.identifier,
241241
allow=[
242242
{
@@ -459,13 +459,13 @@ async def summarize_remote_room(
459459
{
460460
"room_id": restricted_room,
461461
"world_readable": False,
462-
"join_rules": JoinRules.MSC3083_RESTRICTED,
462+
"join_rules": JoinRules.RESTRICTED,
463463
"allowed_spaces": [],
464464
},
465465
{
466466
"room_id": restricted_accessible_room,
467467
"world_readable": False,
468-
"join_rules": JoinRules.MSC3083_RESTRICTED,
468+
"join_rules": JoinRules.RESTRICTED,
469469
"allowed_spaces": [self.room],
470470
},
471471
{

0 commit comments

Comments
 (0)