[omemo] Build sessions automatically

This commit is contained in:
Philipp Hörist
2019-03-08 16:19:56 +01:00
parent ddfd03e79b
commit 2ed1c39f43
4 changed files with 46 additions and 24 deletions

View File

@@ -497,6 +497,12 @@ class LiteAxolotlStore(AxolotlStore):
return self._con.execute(query, jids).fetchall()
def hasUndecidedFingerprints(self, jid):
query = '''SELECT public_key as "public_key [pk]" FROM identities
WHERE recipient_id = ? AND trust = ?'''
result = self._con.execute(query, (jid, Trust.UNDECIDED)).fetchall()
return True if result else False
def getTrustedFingerprints(self, jid):
query = '''SELECT public_key as "public_key [pk]" FROM identities
WHERE recipient_id = ? AND trust = ?'''

View File

@@ -88,7 +88,7 @@ class OmemoState(DeviceManager):
ik)
session.processPreKeyBundle(prekey_bundle)
return self._get_session_cipher(jid, device_id)
self._get_session_cipher(jid, device_id)
@property
def storage(self):