diff --git a/sat/plugins/plugin_xep_0045.py b/sat/plugins/plugin_xep_0045.py index 875de381..52617035 100755 --- a/sat/plugins/plugin_xep_0045.py +++ b/sat/plugins/plugin_xep_0045.py @@ -871,12 +871,14 @@ class SatMUCClient(muc.MUCClient): 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 @@ class SatMUCClient(muc.MUCClient): 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