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

Commit

Permalink
Some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Sep 14, 2020
1 parent 06deecf commit 6ed082d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion changelog.d/8292.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Allow ThirdPartyEventRules modules to query and manipulate whether a room is in the public rooms directory.
Allow `ThirdPartyEventRules` modules to query and manipulate whether a room is in the public rooms directory.
8 changes: 3 additions & 5 deletions synapse/events/third_party_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def check_threepid_can_be_invited(
if self.third_party_rules is None:
return True

state_events = await self._get_state_events_dict_for_room(room_id)
state_events = await self._get_state_map_for_room(room_id)

ret = await self.third_party_rules.check_threepid_can_be_invited(
medium, address, state_events
Expand All @@ -135,13 +135,11 @@ async def check_visibility_can_be_modified(
if not check_func or not isinstance(check_func, Callable):
return True

state_events = await self._get_state_events_dict_for_room(room_id)
state_events = await self._get_state_map_for_room(room_id)

return await check_func(room_id, state_events, new_visibility)

async def _get_state_events_dict_for_room(
self, room_id: str
) -> StateMap[EventBase]:
async def _get_state_map_for_room(self, room_id: str) -> StateMap[EventBase]:
"""Given a room ID, return the state events of that room.
Args:
Expand Down

0 comments on commit 6ed082d

Please sign in to comment.