mirror of
https://github.com/markqvist/NomadNet.git
synced 2024-10-01 01:26:07 -04:00
Added handling for authenticated propagation nodes
This commit is contained in:
parent
2354ba3412
commit
7a625d677d
@ -255,6 +255,9 @@ class NomadNetworkApp:
|
||||
|
||||
if self.enable_node:
|
||||
self.message_router.enable_propagation()
|
||||
|
||||
# TODO: Set LXMF storage limits
|
||||
|
||||
RNS.log("LXMF Propagation Node started on: "+RNS.prettyhexrep(self.message_router.propagation_destination.hash))
|
||||
self.node = nomadnet.Node(self)
|
||||
else:
|
||||
@ -352,6 +355,10 @@ class NomadNetworkApp:
|
||||
return "Done, no new messages"
|
||||
else:
|
||||
return "Downloaded "+str(new_msgs)+" new messages"
|
||||
elif self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_NO_IDENTITY_RCVD:
|
||||
return "Node did not receive identification"
|
||||
elif self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_NO_ACCESS:
|
||||
return "Node did not allow request"
|
||||
else:
|
||||
return "Unknown"
|
||||
|
||||
@ -379,7 +386,7 @@ class NomadNetworkApp:
|
||||
return self.message_router.propagation_transfer_progress
|
||||
|
||||
def request_lxmf_sync(self, limit = None):
|
||||
if self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_IDLE or self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_COMPLETE:
|
||||
if self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_IDLE or self.message_router.propagation_transfer_state >= LXMF.LXMRouter.PR_COMPLETE:
|
||||
self.peer_settings["last_lxmf_sync"] = time.time()
|
||||
self.save_peer_settings()
|
||||
self.message_router.request_messages_from_propagation_node(self.identity, max_messages = limit)
|
||||
|
@ -334,7 +334,7 @@ class ConversationsDisplay():
|
||||
self.dialog_open = False
|
||||
self.sync_dialog = None
|
||||
self.update_conversation_list()
|
||||
if self.app.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_COMPLETE:
|
||||
if self.app.message_router.propagation_transfer_state >= LXMF.LXMRouter.PR_COMPLETE:
|
||||
self.app.cancel_lxmf_sync()
|
||||
|
||||
max_messages_group = []
|
||||
@ -360,7 +360,7 @@ class ConversationsDisplay():
|
||||
real_sync_button = urwid.Button("Sync Now", on_press=sync_now)
|
||||
hidden_sync_button = urwid.Button("Cancel Sync", on_press=cancel_sync)
|
||||
|
||||
if self.app.get_sync_status() == "Idle" or self.app.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_COMPLETE:
|
||||
if self.app.get_sync_status() == "Idle" or self.app.message_router.propagation_transfer_state >= LXMF.LXMRouter.PR_COMPLETE:
|
||||
sync_button = real_sync_button
|
||||
else:
|
||||
sync_button = hidden_sync_button
|
||||
@ -423,7 +423,7 @@ class ConversationsDisplay():
|
||||
if self.dialog_open and self.sync_dialog != None:
|
||||
self.sync_dialog.sync_progress.set_completion(self.app.get_sync_progress())
|
||||
|
||||
if self.app.get_sync_status() == "Idle" or self.app.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_COMPLETE:
|
||||
if self.app.get_sync_status() == "Idle" or self.app.message_router.propagation_transfer_state >= LXMF.LXMRouter.PR_COMPLETE:
|
||||
self.sync_dialog.bc.contents[0] = (self.sync_dialog.real_sync_button, self.sync_dialog.bc.options("weight", 0.45))
|
||||
else:
|
||||
self.sync_dialog.bc.contents[0] = (self.sync_dialog.hidden_sync_button, self.sync_dialog.bc.options("weight", 0.45))
|
||||
|
Loading…
Reference in New Issue
Block a user