From 6cb3a23c9db40ca71773ef406b2a7754c6a23c4f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 3 Sep 2021 23:27:21 +0200 Subject: [PATCH] Updated according to RNS API. --- LXMF/LXMF.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/LXMF/LXMF.py b/LXMF/LXMF.py index 72b4dd6..c395b25 100644 --- a/LXMF/LXMF.py +++ b/LXMF/LXMF.py @@ -542,22 +542,18 @@ class LXMRouter: try: message = LXMessage.unpack_from_bytes(lxmf_data) - if RNS.Reticulum.should_allow_unencrypted(): - message.transport_encrypted = False - message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_UNENCRYPTED + if destination_type == RNS.Destination.SINGLE: + message.transport_encrypted = True + message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_RSA + elif destination_type == RNS.Destination.GROUP: + message.transport_encrypted = True + message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_AES + elif destination_type == RNS.Destination.LINK: + message.transport_encrypted = True + message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_EC else: - if destination_type == RNS.Destination.SINGLE: - message.transport_encrypted = True - message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_RSA - elif destination_type == RNS.Destination.GROUP: - message.transport_encrypted = True - message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_AES - elif destination_type == RNS.Destination.LINK: - message.transport_encrypted = True - message.transport_encryption = LXMessage.ENCRYPTION_DESCRIPTION_EC - else: - message.transport_encrypted = False - message.transport_encryption = None + message.transport_encrypted = False + message.transport_encryption = None if self.__delivery_callback != None: self.__delivery_callback(message)