plugin XEP-0198: retrieve missing messages + send buffered ones on hot reconnection:
Missing one2one messages are now retrieved with MAM on hot reconnection, and buffered ones (which have most probably not been received by the server) are resent at the end of the reconnection workflow. IQ results are not re-sent on hot reconnection, as they don't make sense anymore with a new session. fix 330
This commit is contained in:
parent
1c862e7c3f
commit
6f5718a045
1 changed files with 44 additions and 9 deletions
|
|
@ -73,7 +73,8 @@ class XEP_0313(object):
|
|||
async=True)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def profileConnected(self, client):
|
||||
def resume(self, client):
|
||||
"""Retrieve one2one messages received since the last we have in local storage"""
|
||||
stanza_id_data = yield self.host.memory.storage.getPrivates(
|
||||
mam.NS_MAM, [KEY_LAST_STANZA_ID], profile=client.profile)
|
||||
stanza_id = stanza_id_data.get(KEY_LAST_STANZA_ID)
|
||||
|
|
@ -142,6 +143,9 @@ class XEP_0313(object):
|
|||
log.info(_(u"We have received {num_mess} message(s) while offline.")
|
||||
.format(num_mess=count))
|
||||
|
||||
def profileConnected(self, client):
|
||||
return self.resume(client)
|
||||
|
||||
def getHandler(self, client):
|
||||
mam_client = client._mam = SatMAMClient(self)
|
||||
return mam_client
|
||||
|
|
|
|||
Loading…
Reference in a new issue