From 19386baa570fd3d500fdb711cccd5dabbec25217 Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Tue, 13 Aug 2019 15:20:27 +0530 Subject: Update end date with buffer, useful for any tab which supports MAM and has messages in it. --- poezio/mam.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/poezio/mam.py b/poezio/mam.py index 5bc33a4c..f4adc135 100644 --- a/poezio/mam.py +++ b/poezio/mam.py @@ -133,6 +133,12 @@ def mam_scroll(tab): except: before = None end = datetime.now() + if isinstance(tab, tabs.MucTab) is False: + for message in text_buffer.messages: + time = message.time + if time < end: + end = time + end = end + timedelta(seconds=-1) tzone = datetime.now().astimezone().tzinfo end = end.replace(tzinfo=tzone).astimezone(tz=timezone.utc) end = end.replace(tzinfo=None) -- cgit v1.2.3