diff options
author | Erik Johnston <erik@matrix.org> | 2016-02-09 16:01:40 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-02-09 16:01:40 +0000 |
commit | f28cc4518368955f692a1262a688e907cb22d226 (patch) | |
tree | 0e5ee0c0eae60042c1fc91ef74f2f5900cd95f8a /synapse/push/bulk_push_rule_evaluator.py | |
parent | Remove dead code (diff) | |
download | synapse-f28cc4518368955f692a1262a688e907cb22d226.tar.xz |
Pass in current state to push action handler
Diffstat (limited to 'synapse/push/bulk_push_rule_evaluator.py')
-rw-r--r-- | synapse/push/bulk_push_rule_evaluator.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py index 20c60422bf..8ac5ceb9ef 100644 --- a/synapse/push/bulk_push_rule_evaluator.py +++ b/synapse/push/bulk_push_rule_evaluator.py @@ -98,25 +98,21 @@ class BulkPushRuleEvaluator: self.store = store @defer.inlineCallbacks - def action_for_event_by_user(self, event, handler): + def action_for_event_by_user(self, event, handler, current_state): actions_by_user = {} users_dict = yield self.store.are_guests(self.rules_by_user.keys()) filtered_by_user = yield handler._filter_events_for_clients( - users_dict.items(), [event] + users_dict.items(), [event], {event.event_id: current_state} ) evaluator = PushRuleEvaluatorForEvent(event, len(self.users_in_room)) condition_cache = {} - member_state = yield self.store.get_state_for_event( - event.event_id, - ) - display_names = {} - for ev in member_state.values(): + for ev in current_state.values(): nm = ev.content.get("displayname", None) if nm and ev.type == EventTypes.Member: display_names[ev.state_key] = nm |