summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2018-03-06 11:20:23 +0000
committerGitHub <noreply@github.com>2018-03-06 11:20:23 +0000
commitb2932107bb6ccf3e171ead57d51917624f5e017c (patch)
treee968c520f684bd7e82f70de37c32057205997754 /synapse/handlers
parentMerge pull request #2948 from matrix-org/erikj/kill_as_sync (diff)
parentProvide a means to pass a timestamp to purge_history (diff)
downloadsynapse-b2932107bb6ccf3e171ead57d51917624f5e017c.tar.xz
Merge pull request #2946 from matrix-org/rav/timestamp_to_purge
Implement purge_history by timestamp
Diffstat (limited to 'synapse/handlers')
-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,