Skip to content
Snippets Groups Projects
Commit ce030e75 authored by Daniel Gultsch's avatar Daniel Gultsch
Browse files

moved add_device call after decryption into omemo lib

parent 694c18f0
No related branches found
No related tags found
No related merge requests found
......@@ -142,11 +142,6 @@ class OmemoPlugin(GajimPlugin):
if not plaintext:
return
if my_jid == msg_dict['sender_jid']:
state.add_own_device(msg_dict['sid'])
else:
state.add_device(msg_dict['sender_jid'], msg_dict['sid'])
msg.msgtxt = plaintext
msg.stanza.setBody(msg.msgtxt)
......
......@@ -47,7 +47,6 @@ class OmemoState:
:param connection: an :py:class:`sqlite3.Connection`
"""
self.session_ciphers = {}
self.encryption = None
self.own_jid = own_jid
self.device_ids = {}
self.own_devices = []
......@@ -192,6 +191,12 @@ class OmemoState:
return
result = unicode(aes_decrypt(key, iv, payload))
if self.own_jid == sender_jid:
self.add_own_device(sid)
else:
self.add_device(sender_jid, sid)
log.debug("Decrypted msg ⇒ " + result)
return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment