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

Commit

Permalink
Make matches_user_in_member_list method private
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Mar 3, 2022
1 parent 757daca commit ed41b75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions synapse/appservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _is_exclusive(self, namespace_key: str, test_string: str) -> bool:
return False

@cached(num_args=1, cache_context=True)
async def matches_user_in_member_list(
async def _matches_user_in_member_list(
self,
room_id: str,
store: "DataStore",
Expand Down Expand Up @@ -259,7 +259,7 @@ async def is_interested_in_room(

# And finally, perform an expensive check on whether any of the
# users in the room match the appservice's user namespace
return await self.matches_user_in_member_list(
return await self._matches_user_in_member_list(
room_id, store, on_invalidate=cache_context.invalidate
)

Expand Down Expand Up @@ -316,7 +316,7 @@ async def is_interested_in_presence(

# Then find out if the appservice is interested in any of those rooms
for room_id in room_ids:
if await self.matches_user_in_member_list(
if await self.is_interested_in_room(
room_id, store, on_invalidate=cache_context.invalidate
):
return True
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ async def get_new_events_as(
# Then filter down to rooms that the AS can read
events = []
for room_id, event in rooms_to_events.items():
if not await service.matches_user_in_member_list(room_id, self.store):
if not await service.is_interested_in_room(room_id, self.store):
continue

events.append(event)
Expand Down
4 changes: 1 addition & 3 deletions synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,7 @@ async def get_new_events_as(
if handler._room_serials[room_id] <= from_key:
continue

if not await service.matches_user_in_member_list(
room_id, self._main_store
):
if not await service.is_interested_in_room(room_id, self._main_store):
continue

events.append(self._make_event_for(room_id))
Expand Down

0 comments on commit ed41b75

Please sign in to comment.