plugin XEP-0384: wait for client to be ready if session is missing when onNewDevices is called
This commit is contained in:
parent
a46dda1e12
commit
74bc166b88
1 changed files with 7 additions and 1 deletions
|
|
@ -539,6 +539,8 @@ class OMEMO(object):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def profileConnected(self, client):
|
||||
# FIXME: is _xep_0384_ready needed? can we use profileConnecting?
|
||||
# Workflow should be checked
|
||||
client._xep_0384_ready = defer.Deferred()
|
||||
# we first need to get devices ids (including our own)
|
||||
persistent_dict = persistent.LazyPersistentBinaryDict("XEP-0384", client.profile)
|
||||
|
|
@ -767,7 +769,11 @@ class OMEMO(object):
|
|||
@defer.inlineCallbacks
|
||||
def onNewDevices(self, itemsEvent, profile):
|
||||
client = self.host.getClient(profile)
|
||||
omemo_session = client._xep_0384_session
|
||||
try:
|
||||
omemo_session = client._xep_0384_session
|
||||
except AttributeError:
|
||||
yield client._xep_0384_ready
|
||||
omemo_session = client._xep_0384_session
|
||||
entity = itemsEvent.sender
|
||||
|
||||
devices = self.parseDevices(itemsEvent.items)
|
||||
|
|
|
|||
Loading…
Reference in a new issue