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

[omemo] Dont Fail on empty prekey table

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