Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
3356:569f4cf7183b | 3357:40794e658d68 |
---|---|
84 None, None, limit=1, filters={'not_types': C.MESS_TYPE_GROUPCHAT, | 84 None, None, limit=1, filters={'not_types': C.MESS_TYPE_GROUPCHAT, |
85 'last_stanza_id': True}, | 85 'last_stanza_id': True}, |
86 profile=client.profile) | 86 profile=client.profile) |
87 if not last_mess: | 87 if not last_mess: |
88 log.info(_("It seems that we have no MAM history yet")) | 88 log.info(_("It seems that we have no MAM history yet")) |
89 return | 89 stanza_id = None |
90 stanza_id = last_mess[0][-1]['stanza_id'] | 90 else: |
91 stanza_id = last_mess[0][-1]['stanza_id'] | |
91 rsm_req = rsm.RSMRequest(max_=100, after=stanza_id) | 92 rsm_req = rsm.RSMRequest(max_=100, after=stanza_id) |
92 mam_req = mam.MAMRequest(rsm_=rsm_req) | 93 mam_req = mam.MAMRequest(rsm_=rsm_req) |
93 complete = False | 94 complete = False |
94 count = 0 | 95 count = 0 |
95 while not complete: | 96 while not complete: |