mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-22 04:34:28 +03:00
fix formatting
This commit is contained in:
parent
049a93901c
commit
a1b0cbc262
2 changed files with 24 additions and 19 deletions
|
@ -203,10 +203,7 @@ class E2eRoomKeysHandler(object):
|
|||
)
|
||||
|
||||
count = yield self.store.count_e2e_room_keys(user_id, version)
|
||||
return {
|
||||
"hash": version_hash,
|
||||
"count": count
|
||||
}
|
||||
return {"hash": version_hash, "count": count}
|
||||
|
||||
@staticmethod
|
||||
def _should_replace_room_key(current_room_key, room_key):
|
||||
|
|
|
@ -52,7 +52,7 @@ class EndToEndRoomKeyStore(SQLBaseStore):
|
|||
"is_verified": room_key["is_verified"],
|
||||
"session_data": json.dumps(room_key["session_data"]),
|
||||
},
|
||||
desc="update_e2e_room_key"
|
||||
desc="update_e2e_room_key",
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
@ -67,17 +67,20 @@ class EndToEndRoomKeyStore(SQLBaseStore):
|
|||
|
||||
yield self._simple_insert_many(
|
||||
table="e2e_room_keys",
|
||||
values=[{
|
||||
"user_id": user_id,
|
||||
"version": version,
|
||||
"room_id": room_id,
|
||||
"session_id": session_id,
|
||||
"first_message_index": room_key["first_message_index"],
|
||||
"forwarded_count": room_key["forwarded_count"],
|
||||
"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"
|
||||
values=[
|
||||
{
|
||||
"user_id": user_id,
|
||||
"version": version,
|
||||
"room_id": room_id,
|
||||
"session_id": session_id,
|
||||
"first_message_index": room_key["first_message_index"],
|
||||
"forwarded_count": room_key["forwarded_count"],
|
||||
"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",
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
@ -157,8 +160,11 @@ class EndToEndRoomKeyStore(SQLBaseStore):
|
|||
"""
|
||||
|
||||
return self.runInteraction(
|
||||
"get_e2e_room_keys_multi", self._get_e2e_room_keys_multi_txn,
|
||||
user_id, version, room_keys
|
||||
"get_e2e_room_keys_multi",
|
||||
self._get_e2e_room_keys_multi_txn,
|
||||
user_id,
|
||||
version,
|
||||
room_keys,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
@ -184,7 +190,9 @@ class EndToEndRoomKeyStore(SQLBaseStore):
|
|||
is_verified, session_data
|
||||
FROM e2e_room_keys
|
||||
WHERE user_id = ? AND version = ? AND (%s)
|
||||
""" % (" OR ".join(where_clauses))
|
||||
""" % (
|
||||
" OR ".join(where_clauses)
|
||||
)
|
||||
|
||||
txn.execute(sql, params)
|
||||
|
||||
|
|
Loading…
Reference in a new issue