summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-01-03 16:19:55 +0000
committerRichard van der Hoff <richard@matrix.org>2020-01-06 13:45:33 +0000
commit3bef62488e5cff4dfb33454f2f2e18cc928f319b (patch)
tree8b8c819039eef4d197ba16952eb65b7df3d7171e /synapse/handlers/message.py
parentRemove unused hashes and depths from create_new_client_event params (diff)
downloadsynapse-3bef62488e5cff4dfb33454f2f2e18cc928f319b.tar.xz
Remove unused hashes and depths from create_event params
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py21
1 files changed, 5 insertions, 16 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 5415b0c9ee..8ea3aca2f4 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -422,7 +422,7 @@ class EventCreationHandler(object):
         event_dict,
         token_id=None,
         txn_id=None,
-        prev_events_and_hashes=None,
+        prev_event_ids: Optional[Collection[str]] = None,
         require_consent=True,
     ):
         """
@@ -439,10 +439,9 @@ class EventCreationHandler(object):
             token_id (str)
             txn_id (str)
 
-            prev_events_and_hashes (list[(str, dict[str, str], int)]|None):
+            prev_event_ids:
                 the forward extremities to use as the prev_events for the
-                new event. For each event, a tuple of (event_id, hashes, depth)
-                where *hashes* is a map from algorithm to hash.
+                new event.
 
                 If None, they will be requested from the database.
 
@@ -497,12 +496,6 @@ class EventCreationHandler(object):
         if txn_id is not None:
             builder.internal_metadata.txn_id = txn_id
 
-        prev_event_ids = (
-            None
-            if prev_events_and_hashes is None
-            else [event_id for event_id, _, _ in prev_events_and_hashes]
-        )
-
         event, context = yield self.create_new_client_event(
             builder=builder, requester=requester, prev_event_ids=prev_event_ids,
         )
@@ -1038,11 +1031,7 @@ class EventCreationHandler(object):
             # For each room we need to find a joined member we can use to send
             # the dummy event with.
 
-            prev_events_and_hashes = yield self.store.get_prev_events_and_hashes_for_room(
-                room_id
-            )
-
-            latest_event_ids = (event_id for (event_id, _, _) in prev_events_and_hashes)
+            latest_event_ids = yield self.store.get_prev_events_for_room(room_id)
 
             members = yield self.state.get_current_users_in_room(
                 room_id, latest_event_ids=latest_event_ids
@@ -1061,7 +1050,7 @@ class EventCreationHandler(object):
                             "room_id": room_id,
                             "sender": user_id,
                         },
-                        prev_events_and_hashes=prev_events_and_hashes,
+                        prev_event_ids=latest_event_ids,
                     )
 
                     event.internal_metadata.proactively_send = False