summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-08-13 15:20:27 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 00:54:25 +0530
commit19386baa570fd3d500fdb711cccd5dabbec25217 (patch)
tree5be446c70c85c9df8516dc33a0ab8c2c154b04d6
parentafbff00c14136e9c110ed597078be4e35c368140 (diff)
downloadpoezio-19386baa570fd3d500fdb711cccd5dabbec25217.tar.gz
poezio-19386baa570fd3d500fdb711cccd5dabbec25217.tar.bz2
poezio-19386baa570fd3d500fdb711cccd5dabbec25217.tar.xz
poezio-19386baa570fd3d500fdb711cccd5dabbec25217.zip
Update end date with buffer, useful for any tab which supports MAM and has messages in it.
-rw-r--r--poezio/mam.py6
1 files changed, 6 insertions, 0 deletions
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)