encryption: Return a tuple as well if no decryption session is found.

This commit is contained in:
Damir Jelić 2018-07-13 15:46:21 +02:00
parent 7e1fc69cbf
commit 4323931309

View file

@ -649,12 +649,15 @@ class Olm():
@encrypt_enabled
def group_decrypt(self, room_id, session_id, ciphertext):
if session_id not in self.inbound_group_sessions[room_id]:
return None
return None, None
session = self.inbound_group_sessions[room_id][session_id]
try:
return session.decrypt(ciphertext)
except OlmGroupSessionError:
pass
return None, None
def share_group_session(self, room_id, own_id, users):