From 0e79c3299ca503fb2f2888b85f681b4e257389f8 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 6 Oct 2024 11:25:08 +0200 Subject: [PATCH] Added opportunistic delivery if destination ratchets are available --- nomadnet/Conversation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nomadnet/Conversation.py b/nomadnet/Conversation.py index 7487c87..9b3f804 100644 --- a/nomadnet/Conversation.py +++ b/nomadnet/Conversation.py @@ -216,6 +216,10 @@ class Conversation: if self.app.directory.preferred_delivery(dest.hash) == DirectoryEntry.PROPAGATED: if self.app.message_router.get_outbound_propagation_node() != None: desired_method = LXMF.LXMessage.PROPAGATED + else: + if not self.app.message_router.delivery_link_available(dest.hash) and RNS.Identity.current_ratchet_id(dest.hash) != None: + RNS.log(f"Have ratchet for {RNS.prettyhexrep(dest.hash)}, requesting opportunistic delivery of message", RNS.LOG_DEBUG) + desired_method = LXMF.LXMessage.OPPORTUNISTIC dest_is_trusted = False if self.app.directory.trust_level(dest.hash) == DirectoryEntry.TRUSTED: