summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-03-01 23:20:54 +0000
committerRichard van der Hoff <richard@matrix.org>2018-03-05 14:37:23 +0000
commitf8bfcd7e0d2fc6399eb654a41773cd603b4037fc (patch)
treea1017cd9a4e251d9f70292c24a8b76f529bf4a6f /synapse/handlers/message.py
parentMerge pull request #2943 from matrix-org/rav/fix_find_first_stream_ordering_a... (diff)
downloadsynapse-f8bfcd7e0d2fc6399eb654a41773cd603b4037fc.tar.xz
Provide a means to pass a timestamp to purge_history
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 7d28c2745c..dd00d8a86c 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -52,16 +52,12 @@ class MessageHandler(BaseHandler):
         self.pagination_lock = ReadWriteLock()
 
     @defer.inlineCallbacks
-    def purge_history(self, room_id, event_id, delete_local_events=False):
-        event = yield self.store.get_event(event_id)
-
-        if event.room_id != room_id:
-            raise SynapseError(400, "Event is for wrong room.")
-
-        depth = event.depth
-
+    def purge_history(self, room_id, topological_ordering,
+                      delete_local_events=False):
         with (yield self.pagination_lock.write(room_id)):
-            yield self.store.purge_history(room_id, depth, delete_local_events)
+            yield self.store.purge_history(
+                room_id, topological_ordering, delete_local_events,
+            )
 
     @defer.inlineCallbacks
     def get_messages(self, requester, room_id=None, pagin_config=None,