Merge pull request #2216 from slipeer/app_services_interested_in_user

Fix users claimed non-exclusively by an app service don't get notific…
pull/2231/head
Erik Johnston 2017-05-17 16:28:50 +01:00 committed by GitHub
commit ace23463c5
2 changed files with 6 additions and 3 deletions

View File

@ -39,12 +39,15 @@ class ApplicationServiceStore(SQLBaseStore):
def get_app_services(self):
return self.services_cache
def get_if_app_services_interested_in_user(self, user_id):
def get_if_app_services_interested_in_user(self, user_id, exclusive=False):
"""Check if the user is one associated with an app service
"""
for service in self.services_cache:
if service.is_interested_in_user(user_id):
return True
if exclusive:
return service.is_exclusive_user(user_id)
else:
return True
return False
def get_app_service_by_user_id(self, user_id):

View File

@ -163,7 +163,7 @@ class PushRuleStore(SQLBaseStore):
local_users_in_room = set(
u for u in users_in_room
if self.hs.is_mine_id(u)
and not self.get_if_app_services_interested_in_user(u)
and not self.get_if_app_services_interested_in_user(u, exclusive=True)
)
# users in the room who have pushers need to get push rules run because