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

Commit

Permalink
Merge pull request #2216 from slipeer/app_services_interested_in_user
Browse files Browse the repository at this point in the history
Fix users claimed non-exclusively by an app service don't get notific…
  • Loading branch information
erikjohnston authored May 17, 2017
2 parents 9f430fa + 328378f commit ace2346
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions synapse/storage/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ def __init__(self, hs):
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):
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/push_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _bulk_get_push_rules_for_room(self, room_id, state_group, current_state_ids,
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
Expand Down

0 comments on commit ace2346

Please sign in to comment.