summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-01-07 23:45:26 +0000
committerMatthew Hodgson <matthew@matrix.org>2018-01-07 23:45:26 +0000
commit1976540db7807ef510f3ec9f1d3ca36dae3f4a95 (patch)
treee07475c7f9852305eb5f8712192eb7499c791772
parentflake8 (diff)
downloadsynapse-1976540db7807ef510f3ec9f1d3ca36dae3f4a95.tar.xz
support DELETE /version with no args
-rw-r--r--synapse/handlers/e2e_room_keys.py2
-rw-r--r--synapse/rest/client/v2_alpha/room_keys.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/e2e_room_keys.py b/synapse/handlers/e2e_room_keys.py
index 09c2888db6..a43fc7fc7e 100644
--- a/synapse/handlers/e2e_room_keys.py
+++ b/synapse/handlers/e2e_room_keys.py
@@ -267,7 +267,7 @@ class E2eRoomKeysHandler(object):
         defer.returnValue(results)
 
     @defer.inlineCallbacks
-    def delete_version(self, user_id, version):
+    def delete_version(self, user_id, version=None):
         """Deletes a given version of the user's e2e_room_keys backup
 
         Args:
diff --git a/synapse/rest/client/v2_alpha/room_keys.py b/synapse/rest/client/v2_alpha/room_keys.py
index 8f10e4e1cd..63b1f62f90 100644
--- a/synapse/rest/client/v2_alpha/room_keys.py
+++ b/synapse/rest/client/v2_alpha/room_keys.py
@@ -308,7 +308,7 @@ class RoomKeysVersionServlet(RestServlet):
         It takes out an exclusive lock on this user's room_key backups, to ensure
         clients only upload to the current backup.
 
-        Returns 404 is the given version does not exist.
+        Returns 404 if the given version does not exist.
 
         GET /room_keys/version/12345 HTTP/1.1
         {
@@ -330,7 +330,8 @@ class RoomKeysVersionServlet(RestServlet):
     def on_DELETE(self, request, version):
         """
         Delete the information about a given version of the user's
-        room_keys backup.  Doesn't delete the actual room data.
+        room_keys backup.  If the version part is missing, deletes the most
+        current backup version (if any). Doesn't delete the actual room data.
 
         DELETE /room_keys/version/12345 HTTP/1.1
         HTTP/1.1 200 OK