Added transport encryption indicators to messages

This commit is contained in:
Mark Qvist 2021-05-14 19:38:21 +02:00
parent ab27f17ea9
commit 9a0c4ea6a8
2 changed files with 19 additions and 1 deletions

View File

@ -229,6 +229,18 @@ class ConversationMessage:
return self.lxm.state
def get_transport_encryption(self):
if not self.loaded:
self.load()
return self.lxm.transport_encryption
def get_transport_encrypted(self):
if not self.loaded:
self.load()
return self.lxm.transport_encrypted
def signature_validated(self):
if not self.loaded:
self.load()

View File

@ -567,7 +567,13 @@ class LXMessageWidget(urwid.WidgetWrap):
self.timestamp = message.get_timestamp()
time_format = app.time_format
message_time = datetime.fromtimestamp(self.timestamp)
title_string = message_time.strftime(time_format)
encryption_string = ""
if message.get_transport_encrypted():
encryption_string = " [\U0001F512"+message.get_transport_encryption()+"]"
else:
encryption_string = " [\U0001F513"+message.get_transport_encryption()+"]"
title_string = message_time.strftime(time_format)+encryption_string
if app.lxmf_destination.hash == message.lxm.source_hash:
if message.lxm.state == LXMF.LXMessage.DELIVERED: