Commit 4b63c424 authored by Philipp Hörist's avatar Philipp Hörist

[omemo] Dont Fail on empty prekey table

parent 42b9aeb8
......@@ -80,8 +80,10 @@ class LitePreKeyStore(PreKeyStore):
return cursor.fetchone()[0]
def generateNewPreKeys(self, count):
startId = self.getCurrentPreKeyId() + 1
preKeys = KeyHelper.generatePreKeys(startId, count)
prekey_id = self.getCurrentPreKeyId()
if prekey_id is None:
prekey_id = 0
preKeys = KeyHelper.generatePreKeys(prekey_id + 1, count)
for preKey in preKeys:
self.storePreKey(preKey.getId(), preKey)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment