From 8b4cc9128572404d642e7ea6744e61939e91c66d Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Tue, 16 Jul 2019 15:18:09 +0530 Subject: Fixed issue with the start timestamp (removed it) --- poezio/mam.py | 12 +++++++----- 1 file 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 -- cgit v1.2.3