# HG changeset patch # User Goffi # Date 1544601532 -3600 # Node ID 35a0ab3032bb513c66696f019a7b241fb7b0604e # Parent c6be5962752d7824c30ab1ba1d63d139aaa397ae plugin XEP-0045: don't loop when initiating MAM archive diff -r c6be5962752d -r 35a0ab3032bb sat/plugins/plugin_xep_0045.py --- a/sat/plugins/plugin_xep_0045.py Wed Dec 12 01:13:15 2018 +0100 +++ b/sat/plugins/plugin_xep_0045.py Wed Dec 12 08:58:52 2018 +0100 @@ -871,12 +871,14 @@ if last_mess: stanza_id = last_mess[0][-1][u'stanza_id'] rsm_req = rsm.RSMRequest(max_=100, after=stanza_id) + no_loop=False else: log.info(u"We have no MAM archive for room {room_jid}.".format( room_jid=room_jid)) # we don't want the whole archive if we have no archive yet # as it can be huge rsm_req = rsm.RSMRequest(max_=50, before=u'') + no_loop=True mam_req = mam.MAMRequest(rsm_=rsm_req) complete = False @@ -885,7 +887,7 @@ mam_data = yield self._mam.getArchives(client, mam_req, service=room_jid) elt_list, rsm_response, mam_response = mam_data - complete = mam_response[u"complete"] + complete = True if no_loop else mam_response[u"complete"] # we update MAM request for next iteration mam_req.rsm.after = rsm_response.last