Commit cc8c808e authored by Madhur Garg's avatar Madhur Garg

Added await on the get_info call so that MAM support is checked first before proceeding further.

parent 7ea48f4c
......@@ -42,10 +42,9 @@ async def query(self, remote_jid, start, end, top):
self.start_date = start
self.end_date = end
text_buffer = self._text_buffer
def callback(iq):
if 'urn:xmpp:mam:2' not in iq['disco_info'].get_features():
return self.core.information("This MUC doesn't support MAM.", "Error")
self.core.xmpp.plugin['xep_0030'].get_info(jid=remote_jid, callback=callback)
iq = await self.core.xmpp.plugin['xep_0030'].get_info(jid=remote_jid)
if 'urn:xmpp:mam:2' not in iq['disco_info'].get_features():
return self.core.information("This MUC doesn't support MAM.", "Error")
if top:
results = self.core.xmpp['xep_0313'].retrieve(jid=self.remote_jid,
iterator=True, reverse=top, end=self.end_date)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment