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

Commit b4a6c56

Browse files
committed
Remove typoed join_rules flag.
1 parent 3429b1e commit b4a6c56

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

synapse/handlers/room_summary.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ async def _is_remote_room_accessible(
662662
# The API doesn't return the room version so assume that a
663663
# join rule of knock is valid.
664664
if (
665-
room.get("join_rules") in (JoinRules.PUBLIC, JoinRules.KNOCK)
665+
room.get("join_rule") in (JoinRules.PUBLIC, JoinRules.KNOCK)
666666
or room.get("world_readable") is True
667667
):
668668
return True
@@ -713,9 +713,6 @@ async def _build_room_entry(self, room_id: str, for_federation: bool) -> JsonDic
713713
"canonical_alias": stats["canonical_alias"],
714714
"num_joined_members": stats["joined_members"],
715715
"avatar_url": stats["avatar"],
716-
# plural join_rules is a documentation error but kept for historical
717-
# purposes. Should match /publicRooms.
718-
"join_rules": stats["join_rules"],
719716
"join_rule": stats["join_rules"],
720717
"world_readable": (
721718
stats["history_visibility"] == HistoryVisibility.WORLD_READABLE

tests/handlers/test_room_summary.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,39 +772,39 @@ def test_fed_filtering(self):
772772
{
773773
"room_id": public_room,
774774
"world_readable": False,
775-
"join_rules": JoinRules.PUBLIC,
775+
"join_rule": JoinRules.PUBLIC,
776776
},
777777
),
778778
(
779779
knock_room,
780780
{
781781
"room_id": knock_room,
782782
"world_readable": False,
783-
"join_rules": JoinRules.KNOCK,
783+
"join_rule": JoinRules.KNOCK,
784784
},
785785
),
786786
(
787787
not_invited_room,
788788
{
789789
"room_id": not_invited_room,
790790
"world_readable": False,
791-
"join_rules": JoinRules.INVITE,
791+
"join_rule": JoinRules.INVITE,
792792
},
793793
),
794794
(
795795
invited_room,
796796
{
797797
"room_id": invited_room,
798798
"world_readable": False,
799-
"join_rules": JoinRules.INVITE,
799+
"join_rule": JoinRules.INVITE,
800800
},
801801
),
802802
(
803803
restricted_room,
804804
{
805805
"room_id": restricted_room,
806806
"world_readable": False,
807-
"join_rules": JoinRules.RESTRICTED,
807+
"join_rule": JoinRules.RESTRICTED,
808808
"allowed_room_ids": [],
809809
},
810810
),
@@ -813,7 +813,7 @@ def test_fed_filtering(self):
813813
{
814814
"room_id": restricted_accessible_room,
815815
"world_readable": False,
816-
"join_rules": JoinRules.RESTRICTED,
816+
"join_rule": JoinRules.RESTRICTED,
817817
"allowed_room_ids": [self.room],
818818
},
819819
),
@@ -822,15 +822,15 @@ def test_fed_filtering(self):
822822
{
823823
"room_id": world_readable_room,
824824
"world_readable": True,
825-
"join_rules": JoinRules.INVITE,
825+
"join_rule": JoinRules.INVITE,
826826
},
827827
),
828828
(
829829
joined_room,
830830
{
831831
"room_id": joined_room,
832832
"world_readable": False,
833-
"join_rules": JoinRules.INVITE,
833+
"join_rule": JoinRules.INVITE,
834834
},
835835
),
836836
)
@@ -911,7 +911,7 @@ def test_fed_invited(self):
911911
{
912912
"room_id": fed_room,
913913
"world_readable": False,
914-
"join_rules": JoinRules.INVITE,
914+
"join_rule": JoinRules.INVITE,
915915
},
916916
)
917917

0 commit comments

Comments
 (0)