summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-07-20 01:49:03 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 00:54:25 +0530
commitcc8c808e10b484fb7593d8eb84ac11fcd6925c5c (patch)
tree40c075c676425e3ff8a2cd779a21738b8f0af15c
parent7ea48f4cdca57cda89121ab07eae39848ebebc60 (diff)
downloadpoezio-cc8c808e10b484fb7593d8eb84ac11fcd6925c5c.tar.gz
poezio-cc8c808e10b484fb7593d8eb84ac11fcd6925c5c.tar.bz2
poezio-cc8c808e10b484fb7593d8eb84ac11fcd6925c5c.tar.xz
poezio-cc8c808e10b484fb7593d8eb84ac11fcd6925c5c.zip
Added await on the get_info call so that MAM support is checked first before proceeding further.
-rw-r--r--poezio/mam.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/poezio/mam.py b/poezio/mam.py
index 93e76d34..28173994 100644
--- a/poezio/mam.py
+++ b/poezio/mam.py
@@ -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)