summary refs log tree commit diff
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2019-09-04 19:04:58 -0400
committerHubert Chathi <hubert@uhoreg.ca>2019-09-04 19:04:58 -0400
commitf5893908429597afbba477449610383f54761940 (patch)
tree06e5fc666f0df283be8e1f4013f40cbe77250db0
parentMerge branch 'develop' into uhoreg/e2e_backup_hash (diff)
downloadsynapse-f5893908429597afbba477449610383f54761940.tar.xz
fix merge conflict
-rw-r--r--synapse/storage/e2e_room_keys.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/synapse/storage/e2e_room_keys.py b/synapse/storage/e2e_room_keys.py
index 7edf22d1c1..cb641468da 100644
--- a/synapse/storage/e2e_room_keys.py
+++ b/synapse/storage/e2e_room_keys.py
@@ -66,9 +66,9 @@ class EndToEndRoomKeyStore(SQLBaseStore):
             room_keys(iterable[dict]): the keys to add
         """
 
-        yield self._simple_insert_many(
-            table="e2e_room_keys",
-            values=[
+        values = []
+        for (room_id, session_id, room_key) in room_keys:
+            values.append(
                 {
                     "user_id": user_id,
                     "version": version,
@@ -79,17 +79,18 @@ class EndToEndRoomKeyStore(SQLBaseStore):
                     "is_verified": room_key["is_verified"],
                     "session_data": json.dumps(room_key["session_data"]),
                 }
-                for (room_id, session_id, room_key) in room_keys
-            ],
-            desc="add_e2e_room_keys",
-        )
-        log_kv(
-            {
-                "message": "Set room key",
-                "room_id": room_id,
-                "session_id": session_id,
-                "room_key": room_key,
-            }
+            )
+            log_kv(
+                {
+                    "message": "Set room key",
+                    "room_id": room_id,
+                    "session_id": session_id,
+                    "room_key": room_key,
+                }
+            )
+
+        yield self._simple_insert_many(
+            table="e2e_room_keys", values=values, desc="add_e2e_room_keys"
         )
 
     @trace