From a813e84ff58385858784ec01b45ea174cdb46f62 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 8 Sep 2024 17:50:04 +0200 Subject: [PATCH] Updated message encryption descriptions --- sbapp/ui/messages.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py index 6a04b61..027ea0f 100644 --- a/sbapp/ui/messages.py +++ b/sbapp/ui/messages.py @@ -123,21 +123,26 @@ class Messages(): else: d_text += f"[size={ss}][b]Signature[/b] is invalid[/size]\n" - ratchet_method = "" - if "method" in msg: - if msg["method"] == LXMF.LXMessage.UNKNOWN: - d_text += f"[size={ss}][b]Delivered[/b] via unknown method[/size]\n" - if msg["method"] == LXMF.LXMessage.OPPORTUNISTIC: - d_text += f"[size={ss}][b]Delivered[/b] opportunistically[/size]\n" - if msg["method"] == LXMF.LXMessage.DIRECT: - ratchet_method = "link " - d_text += f"[size={ss}][b]Delivered[/b] over direct link[/size]\n" - if msg["method"] == LXMF.LXMessage.PROPAGATED: - d_text += f"[size={ss}][b]Delivered[/b] to propagation network[/size]\n" + ratchet_method = "" + if "method" in msg: + if msg["method"] == LXMF.LXMessage.UNKNOWN: + d_text += f"[size={ss}][b]Delivered[/b] via unknown method[/size]\n" + if msg["method"] == LXMF.LXMessage.OPPORTUNISTIC: + d_text += f"[size={ss}][b]Delivered[/b] opportunistically[/size]\n" + if msg["method"] == LXMF.LXMessage.DIRECT: + ratchet_method = "link " + d_text += f"[size={ss}][b]Delivered[/b] over direct link[/size]\n" + if msg["method"] == LXMF.LXMessage.PROPAGATED: + d_text += f"[size={ss}][b]Delivered[/b] to propagation network[/size]\n" if msg["extras"] != None and "ratchet_id" in msg["extras"]: r_str = RNS.prettyhexrep(msg["extras"]["ratchet_id"]) d_text += f"[size={ss}][b]Encrypted[/b] with {ratchet_method}ratchet {r_str}[/size]\n" + else: + if msg["method"] == LXMF.LXMessage.OPPORTUNISTIC or msg["method"] == LXMF.LXMessage.PROPAGATED: + d_text += f"[size={ss}][b]Encrypted[/b] with your identity key[/size]\n" + else: + d_text += f"[size={ss}][b]Encryption[/b] status unknown[/size]\n" if msg["extras"] != None and "stamp_checked" in msg["extras"]: valid_str = " is not valid"