diff options
author | Matthew Hodgson <matthew@matrix.org> | 2017-12-24 15:03:44 +0000 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2018-08-12 19:14:31 -0400 |
commit | ca0b052307de8868d3e337f1ace5667dad740ab1 (patch) | |
tree | 84624518a626e2474ad8af317ae899a4a3211601 /synapse/handlers/e2e_room_keys.py | |
parent | rename room_key_version table correctly, and fix opt args (diff) | |
download | synapse-ca0b052307de8868d3e337f1ace5667dad740ab1.tar.xz |
fix factoring out of _should_replace_room_key
Diffstat (limited to 'synapse/handlers/e2e_room_keys.py')
-rw-r--r-- | synapse/handlers/e2e_room_keys.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/e2e_room_keys.py b/synapse/handlers/e2e_room_keys.py index 87be081b1c..b67d6a2a7e 100644 --- a/synapse/handlers/e2e_room_keys.py +++ b/synapse/handlers/e2e_room_keys.py @@ -100,15 +100,16 @@ class E2eRoomKeysHandler(object): else: raise e - if _should_replace_room_key(current_room_key, room_key): + if E2eRoomKeysHandler._should_replace_room_key(current_room_key, room_key): yield self.store.set_e2e_room_key( user_id, version, room_id, session_id, room_key ) + @staticmethod def _should_replace_room_key(current_room_key, room_key): """ - Determine whether to replace the current_room_key in our backup for this - session (if any) with a new room_key that has been uploaded. + Determine whether to replace a given current_room_key (if any) + with a newly uploaded room_key backup Args: current_room_key (dict): Optional, the current room_key dict if any |