From 0823b72accdde4f1812a45beb061ce61e18c15b3 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 1 Mar 2020 15:28:11 +0100 Subject: Add timestamps to backlogged messages --- external/messenger.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'external') diff --git a/external/messenger.py b/external/messenger.py index 2162ced..cd5d972 100755 --- a/external/messenger.py +++ b/external/messenger.py @@ -162,6 +162,11 @@ class InitialSyncThread(threading.Thread): else: messages.append(m) for m in reversed(messages): + if m.text is None: + m.text = "" + m.text = "[{}] {}".format( + time.strftime("%Y-%m-%d %H:%M %Z", time.localtime(float(m.timestamp)/1000)).strip(), + m.text) self.bridge.onMessage(thread_id=thread.uid, thread_type=thread.type, message_object=m) -- cgit v1.2.3