diff options
author | Alex Auvolat <alex@adnab.me> | 2020-03-01 15:28:11 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-03-01 15:28:11 +0100 |
commit | 0823b72accdde4f1812a45beb061ce61e18c15b3 (patch) | |
tree | a94bc23c2e312d32564bd87baade8ccba59f15dd /external | |
parent | b45340629957a9c22132e934d23b069f609431f3 (diff) | |
download | easybridge-0823b72accdde4f1812a45beb061ce61e18c15b3.tar.gz easybridge-0823b72accdde4f1812a45beb061ce61e18c15b3.zip |
Add timestamps to backlogged messages
Diffstat (limited to 'external')
-rwxr-xr-x | external/messenger.py | 5 |
1 files changed, 5 insertions, 0 deletions
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) |