Skip to content

Commit

Permalink
Added opportunistic delivery if destination ratchets are available
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Oct 6, 2024
1 parent c61da06 commit 0e79c32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nomadnet/Conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ def send(self, content="", title=""):
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:
Expand Down

0 comments on commit 0e79c32

Please sign in to comment.