summaryrefslogtreecommitdiff
path: root/poezio/mam.py
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-07-09 16:05:25 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 00:54:25 +0530
commit8470e5251685cf8bc388d5ef9661b55950d2037a (patch)
tree8d26910d48875d996b8a59269916d9763bed8e42 /poezio/mam.py
parenta592baf4381e249d00cd6471a4566775ee367ac4 (diff)
downloadpoezio-8470e5251685cf8bc388d5ef9661b55950d2037a.tar.gz
poezio-8470e5251685cf8bc388d5ef9661b55950d2037a.tar.bz2
poezio-8470e5251685cf8bc388d5ef9661b55950d2037a.tar.xz
poezio-8470e5251685cf8bc388d5ef9661b55950d2037a.zip
Added check for MAM support in disco#info
Diffstat (limited to 'poezio/mam.py')
-rw-r--r--poezio/mam.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/poezio/mam.py b/poezio/mam.py
index 7600f137..7716e851 100644
--- a/poezio/mam.py
+++ b/poezio/mam.py
@@ -41,6 +41,10 @@ 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)
results = self.core.xmpp['xep_0313'].retrieve(jid=self.remote_jid,
iterator=True, reverse=top, start=self.start_date, end=self.end_date)
msg_count = 0