fix factoring out of _should_replace_room_key

This commit is contained in:
Matthew Hodgson 2017-12-24 15:03:44 +00:00 committed by Hubert Chathi
parent cac0253799
commit ca0b052307

View File

@ -100,15 +100,16 @@ class E2eRoomKeysHandler(object):
else: else:
raise e 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( yield self.store.set_e2e_room_key(
user_id, version, room_id, session_id, room_key user_id, version, room_id, session_id, room_key
) )
@staticmethod
def _should_replace_room_key(current_room_key, room_key): def _should_replace_room_key(current_room_key, room_key):
""" """
Determine whether to replace the current_room_key in our backup for this Determine whether to replace a given current_room_key (if any)
session (if any) with a new room_key that has been uploaded. with a newly uploaded room_key backup
Args: Args:
current_room_key (dict): Optional, the current room_key dict if any current_room_key (dict): Optional, the current room_key dict if any