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

Commit

Permalink
Remove typoed join_rules flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed May 23, 2022
1 parent 3429b1e commit b4a6c56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
5 changes: 1 addition & 4 deletions synapse/handlers/room_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ async def _is_remote_room_accessible(
# The API doesn't return the room version so assume that a
# join rule of knock is valid.
if (
room.get("join_rules") in (JoinRules.PUBLIC, JoinRules.KNOCK)
room.get("join_rule") in (JoinRules.PUBLIC, JoinRules.KNOCK)
or room.get("world_readable") is True
):
return True
Expand Down Expand Up @@ -713,9 +713,6 @@ async def _build_room_entry(self, room_id: str, for_federation: bool) -> JsonDic
"canonical_alias": stats["canonical_alias"],
"num_joined_members": stats["joined_members"],
"avatar_url": stats["avatar"],
# plural join_rules is a documentation error but kept for historical
# purposes. Should match /publicRooms.
"join_rules": stats["join_rules"],
"join_rule": stats["join_rules"],
"world_readable": (
stats["history_visibility"] == HistoryVisibility.WORLD_READABLE
Expand Down
18 changes: 9 additions & 9 deletions tests/handlers/test_room_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,39 +772,39 @@ def test_fed_filtering(self):
{
"room_id": public_room,
"world_readable": False,
"join_rules": JoinRules.PUBLIC,
"join_rule": JoinRules.PUBLIC,
},
),
(
knock_room,
{
"room_id": knock_room,
"world_readable": False,
"join_rules": JoinRules.KNOCK,
"join_rule": JoinRules.KNOCK,
},
),
(
not_invited_room,
{
"room_id": not_invited_room,
"world_readable": False,
"join_rules": JoinRules.INVITE,
"join_rule": JoinRules.INVITE,
},
),
(
invited_room,
{
"room_id": invited_room,
"world_readable": False,
"join_rules": JoinRules.INVITE,
"join_rule": JoinRules.INVITE,
},
),
(
restricted_room,
{
"room_id": restricted_room,
"world_readable": False,
"join_rules": JoinRules.RESTRICTED,
"join_rule": JoinRules.RESTRICTED,
"allowed_room_ids": [],
},
),
Expand All @@ -813,7 +813,7 @@ def test_fed_filtering(self):
{
"room_id": restricted_accessible_room,
"world_readable": False,
"join_rules": JoinRules.RESTRICTED,
"join_rule": JoinRules.RESTRICTED,
"allowed_room_ids": [self.room],
},
),
Expand All @@ -822,15 +822,15 @@ def test_fed_filtering(self):
{
"room_id": world_readable_room,
"world_readable": True,
"join_rules": JoinRules.INVITE,
"join_rule": JoinRules.INVITE,
},
),
(
joined_room,
{
"room_id": joined_room,
"world_readable": False,
"join_rules": JoinRules.INVITE,
"join_rule": JoinRules.INVITE,
},
),
)
Expand Down Expand Up @@ -911,7 +911,7 @@ def test_fed_invited(self):
{
"room_id": fed_room,
"world_readable": False,
"join_rules": JoinRules.INVITE,
"join_rule": JoinRules.INVITE,
},
)

Expand Down

0 comments on commit b4a6c56

Please sign in to comment.