From f5e168cb9382d38c7e852ed6ac93f5bf9eb75e0f Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Fri, 9 Oct 2020 09:49:14 +0100 Subject: [PATCH] Fix tests --- synapse/appservice/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py index fc89abad38..ca61d09d84 100644 --- a/synapse/appservice/__init__.py +++ b/synapse/appservice/__init__.py @@ -196,7 +196,7 @@ class ApplicationService: return True return False - async def is_interested(self, event: EventBase, store: "DataStore") -> bool: + async def is_interested(self, event: EventBase, store: Optional["DataStore"] = None) -> bool: """Check if this service is interested in this event. Args: @@ -208,10 +208,13 @@ class ApplicationService: if self._matches_room_id(event): return True - if await self._matches_aliases(event, store): + # This will check the namespaces first before + # checking the store, so should be run before _matches_aliases + if await self._matches_user(event, store): return True - if await self._matches_user(event, store): + # This will check the store, so should be run last + if await self._matches_aliases(event, store): return True return False