From 82bb479957bf31f7ad5852b1baaa6008593fdade Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 2 Nov 2023 12:25:36 +0100 Subject: [PATCH] Adjusted timeouts --- nomadnet/Conversation.py | 2 +- nomadnet/ui/textui/Browser.py | 4 ++-- nomadnet/ui/textui/Conversations.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nomadnet/Conversation.py b/nomadnet/Conversation.py index 253a50a..a79d60b 100644 --- a/nomadnet/Conversation.py +++ b/nomadnet/Conversation.py @@ -142,7 +142,7 @@ class Conversation: self.__changed_callback = None - if not RNS.Transport.has_path(bytes.fromhex(source_hash)): + if not RNS.Identity.recall(bytes.fromhex(self.source_hash)): RNS.Transport.request_path(bytes.fromhex(source_hash)) self.source_identity = RNS.Identity.recall(bytes.fromhex(self.source_hash)) diff --git a/nomadnet/ui/textui/Browser.py b/nomadnet/ui/textui/Browser.py index d5f3763..54afaa7 100644 --- a/nomadnet/ui/textui/Browser.py +++ b/nomadnet/ui/textui/Browser.py @@ -517,7 +517,7 @@ class Browser: self.status = Browser.PATH_REQUESTED self.update_display() - pr_time = time.time() + pr_time = time.time()+RNS.Transport.first_hop_timeout(self.destination_hash) while not RNS.Transport.has_path(self.destination_hash): now = time.time() if now > pr_time+self.timeout: @@ -770,7 +770,7 @@ class Browser: self.status = Browser.PATH_REQUESTED self.update_display() - pr_time = time.time() + pr_time = time.time()+RNS.Transport.first_hop_timeout(self.destination_hash) while not RNS.Transport.has_path(self.destination_hash): now = time.time() if now > pr_time+self.timeout: diff --git a/nomadnet/ui/textui/Conversations.py b/nomadnet/ui/textui/Conversations.py index e942fae..5417fe2 100644 --- a/nomadnet/ui/textui/Conversations.py +++ b/nomadnet/ui/textui/Conversations.py @@ -894,7 +894,7 @@ class ConversationWidget(urwid.WidgetWrap): if allowed: self.frame.contents["footer"] = (self.minimal_editor, None) else: - warning = urwid.AttrMap(urwid.Padding(urwid.Text("\n"+g["info"]+"\n\nYou cannot currently message this peer, since it's identity keys are not known.\n\nWait for an announce to arrive from the peer, or query the network for it.\n\nTo query the network, select this conversation in the conversation list, press Ctrl-E, and use the query button.\n", align="center")), "msg_header_caution") + warning = urwid.AttrMap(urwid.Padding(urwid.Text("\n"+g["info"]+"\n\nYou cannot currently message this peer, since it's identity keys are not known. The keys have been requested from the network and should arrive shortly, if available. Close this conversation and reopen it to try again.\n\nWait for this announce to arrive from, or query the network manually.\n\nTo query the network, select this conversation in the conversation list, press Ctrl-E, and use the query button.\n", align="center")), "msg_header_caution") self.frame.contents["footer"] = (warning, None) def toggle_focus_area(self):