summaryrefslogtreecommitdiff
path: root/poezio/mam.py
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-07-16 15:18:09 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 00:54:25 +0530
commit8b4cc9128572404d642e7ea6744e61939e91c66d (patch)
tree13493614f1e6ae59a518d555bd10e0b690999b0e /poezio/mam.py
parent2ca14edbb5fa27ad39f596e92e640a38e94ac4f8 (diff)
downloadpoezio-8b4cc9128572404d642e7ea6744e61939e91c66d.tar.gz
poezio-8b4cc9128572404d642e7ea6744e61939e91c66d.tar.bz2
poezio-8b4cc9128572404d642e7ea6744e61939e91c66d.tar.xz
poezio-8b4cc9128572404d642e7ea6744e61939e91c66d.zip
Fixed issue with the start timestamp (removed it)
Diffstat (limited to 'poezio/mam.py')
-rw-r--r--poezio/mam.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/poezio/mam.py b/poezio/mam.py
index 7b22e5a1..93e76d34 100644
--- a/poezio/mam.py
+++ b/poezio/mam.py
@@ -46,8 +46,12 @@ async def query(self, remote_jid, start, end, top):
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)
+ if top:
+ results = self.core.xmpp['xep_0313'].retrieve(jid=self.remote_jid,
+ iterator=True, reverse=top, end=self.end_date)
+ else:
+ 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
msgs = []
timestamp = datetime.now()
@@ -95,9 +99,7 @@ def mam_scroll(self):
end = end.replace(tzinfo=tzone).astimezone(tz=timezone.utc)
end = end.replace(tzinfo=None)
end = datetime.strftime(end, '%Y-%m-%dT%H:%M:%SZ')
- start = datetime.strptime(end, '%Y-%m-%dT%H:%M:%SZ')
- start = start + timedelta(days=-360)
- start = datetime.strftime(start, '%Y-%m-%dT%H:%M:%SZ')
+ start = False
top = True
pos = self.text_win.pos
self.text_win.pos += self.text_win.height - 1