summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-02-20 12:29:50 +0000
committerErik Johnston <erik@matrix.org>2018-02-20 12:34:28 +0000
commitad0ccf15ea35603c9453523acb3f43661fdbaa12 (patch)
treea5c747f57884509444ba4d74d4b5c7156a8749cf /synapse/storage/events.py
parentMerge pull request #2868 from matrix-org/erikj/refactor_media_storage (diff)
downloadsynapse-ad0ccf15ea35603c9453523acb3f43661fdbaa12.tar.xz
Refactor _set_push_actions_for_event_and_users_txn to use events_and_contexts
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 73177e0bc2..c8b8abc2e7 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -1162,16 +1162,17 @@ class EventsStore(SQLBaseStore):
             backfilled (bool): True if the events were backfilled
         """
 
+        # Insert all the push actions into the event_push_actions table.
+        self._set_push_actions_for_event_and_users_txn(
+            txn,
+            events_and_contexts=events_and_contexts,
+        )
+
         if not events_and_contexts:
             # nothing to do here
             return
 
         for event, context in events_and_contexts:
-            # Insert all the push actions into the event_push_actions table.
-            self._set_push_actions_for_event_and_users_txn(
-                txn, event,
-            )
-
             if event.type == EventTypes.Redaction and event.redacts is not None:
                 # Remove the entries in the event_push_actions table for the
                 # redacted event.