diff sat/plugins/plugin_xep_0313.py @ 3357:40794e658d68

plugin XEP-0313: fix getting MAM archive when history is empty
author Goffi <goffi@goffi.org>
date Thu, 17 Sep 2020 11:27:57 +0200
parents 569f4cf7183b
children 000b6722bd35
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0313.py	Thu Sep 17 10:46:13 2020 +0200
+++ b/sat/plugins/plugin_xep_0313.py	Thu Sep 17 11:27:57 2020 +0200
@@ -86,8 +86,9 @@
                 profile=client.profile)
             if not last_mess:
                 log.info(_("It seems that we have no MAM history yet"))
-                return
-            stanza_id = last_mess[0][-1]['stanza_id']
+                stanza_id = None
+            else:
+                stanza_id = last_mess[0][-1]['stanza_id']
         rsm_req = rsm.RSMRequest(max_=100, after=stanza_id)
         mam_req = mam.MAMRequest(rsm_=rsm_req)
         complete = False