diff options
author | Erik Johnston <erik@matrix.org> | 2016-02-10 14:12:48 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-02-10 14:12:48 +0000 |
commit | e66d0bd03abc75b5a0445acadc776ba23e1090ba (patch) | |
tree | d73f7c0c2621a27c1637223213a930e40140728d /synapse/push/action_generator.py | |
parent | Update CHANGES (diff) | |
parent | Merge pull request #569 from matrix-org/erikj/initial_sync (diff) | |
download | synapse-e66d0bd03abc75b5a0445acadc776ba23e1090ba.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.13.0
Diffstat (limited to 'synapse/push/action_generator.py')
-rw-r--r-- | synapse/push/action_generator.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/synapse/push/action_generator.py b/synapse/push/action_generator.py index 1d2e558f9a..e0da0868ec 100644 --- a/synapse/push/action_generator.py +++ b/synapse/push/action_generator.py @@ -19,8 +19,6 @@ import bulk_push_rule_evaluator import logging -from synapse.api.constants import EventTypes - logger = logging.getLogger(__name__) @@ -36,21 +34,15 @@ class ActionGenerator: # tag (ie. we just need all the users). @defer.inlineCallbacks - def handle_push_actions_for_event(self, event, handler): - if event.type == EventTypes.Redaction and event.redacts is not None: - yield self.store.remove_push_actions_for_event_id( - event.room_id, event.redacts - ) - + def handle_push_actions_for_event(self, event, context, handler): bulk_evaluator = yield bulk_push_rule_evaluator.evaluator_for_room_id( event.room_id, self.hs, self.store ) - actions_by_user = yield bulk_evaluator.action_for_event_by_user(event, handler) - - yield self.store.set_push_actions_for_event_and_users( - event, - [ - (uid, None, actions) for uid, actions in actions_by_user.items() - ] + actions_by_user = yield bulk_evaluator.action_for_event_by_user( + event, handler, context.current_state ) + + context.push_actions = [ + (uid, None, actions) for uid, actions in actions_by_user.items() + ] |