mirror of
https://github.com/markqvist/NomadNet.git
synced 2024-10-01 01:26:07 -04:00
Get announce display name from callback instead of static
This commit is contained in:
parent
5b187b5d20
commit
7783f2eddf
@ -136,6 +136,7 @@ class NomadNetworkApp:
|
||||
self.message_router.register_delivery_callback(self.lxmf_delivery)
|
||||
|
||||
self.lxmf_destination = self.message_router.register_delivery_identity(self.identity, display_name=self.peer_settings["display_name"])
|
||||
self.lxmf_destination.set_default_app_data(self.get_display_name_bytes)
|
||||
|
||||
RNS.Identity.remember(
|
||||
packet_hash=None,
|
||||
@ -155,12 +156,14 @@ class NomadNetworkApp:
|
||||
def set_display_name(self, display_name):
|
||||
self.peer_settings["display_name"] = display_name
|
||||
self.lxmf_destination.display_name = display_name
|
||||
self.lxmf_destination.set_default_app_data(display_name.encode("utf-8"))
|
||||
self.save_peer_settings()
|
||||
|
||||
def get_display_name(self):
|
||||
return self.peer_settings["display_name"]
|
||||
|
||||
def get_display_name_bytes(self):
|
||||
return self.peer_settings["display_name"].encode("utf-8")
|
||||
|
||||
def announce_now(self):
|
||||
self.lxmf_destination.announce()
|
||||
self.peer_settings["last_announce"] = time.time()
|
||||
|
Loading…
Reference in New Issue
Block a user