mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:06:06 -04:00
Add enable/disable overlay for push rules (REST API not yet hooked up)
This commit is contained in:
parent
a025055643
commit
94fa334b01
5 changed files with 46 additions and 0 deletions
|
@ -82,6 +82,8 @@ class Pusher(object):
|
|||
r['conditions'] = json.loads(r['conditions'])
|
||||
r['actions'] = json.loads(r['actions'])
|
||||
|
||||
enabled_map = yield self.store.get_push_rules_enabled_for_user_name(self.user_name)
|
||||
|
||||
user = UserID.from_string(self.user_name)
|
||||
|
||||
rules = baserules.list_with_base_rules(rawrules, user)
|
||||
|
@ -107,6 +109,8 @@ class Pusher(object):
|
|||
room_member_count += 1
|
||||
|
||||
for r in rules:
|
||||
if r['rule_id'] in enabled_map and not enabled_map[r['rule_id']]:
|
||||
continue
|
||||
matches = True
|
||||
|
||||
conditions = r['conditions']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue