summary refs log tree commit diff
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2018-08-21 10:38:00 -0400
committerHubert Chathi <hubert@uhoreg.ca>2018-08-21 10:38:00 -0400
commit8550a7e9c2fcf9e46c717127d14c79010350a998 (patch)
treedba8a3f60e94ffa4c56ee498e89fd0fc06b59fa3
parentmissing import (diff)
downloadsynapse-8550a7e9c2fcf9e46c717127d14c79010350a998.tar.xz
allow auth_data to be any JSON instead of a string
-rw-r--r--synapse/storage/e2e_room_keys.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/e2e_room_keys.py b/synapse/storage/e2e_room_keys.py
index 089989fcfa..c7b1fad21e 100644
--- a/synapse/storage/e2e_room_keys.py
+++ b/synapse/storage/e2e_room_keys.py
@@ -15,6 +15,7 @@
 
 from twisted.internet import defer
 from synapse.api.errors import StoreError
+import simplejson as json
 
 from ._base import SQLBaseStore
 
@@ -215,7 +216,7 @@ class EndToEndRoomKeyStore(SQLBaseStore):
             else:
                 this_version = version
 
-            return self._simple_select_one_txn(
+            result = self._simple_select_one_txn(
                 txn,
                 table="e2e_room_keys_versions",
                 keyvalues={
@@ -228,6 +229,8 @@ class EndToEndRoomKeyStore(SQLBaseStore):
                     "auth_data",
                 ),
             )
+            result["auth_data"] = json.loads(result["auth_data"])
+            return result
 
         return self.runInteraction(
             "get_e2e_room_keys_version_info",
@@ -264,7 +267,7 @@ class EndToEndRoomKeyStore(SQLBaseStore):
                     "user_id": user_id,
                     "version": new_version,
                     "algorithm": info["algorithm"],
-                    "auth_data": info["auth_data"],
+                    "auth_data": json.dumps(info["auth_data"]),
                 },
             )