fix updating display name on lxmf destination

This commit is contained in:
liamcottle 2024-04-29 23:53:26 +12:00
parent e5410517bc
commit 193a3c0a5e

7
web.py
View file

@ -63,6 +63,7 @@ class ReticulumWebChat:
# update display name from config
if "display_name" in config:
self.display_name = config["display_name"]
self.set_lxmf_display_name(self.display_name)
# return loaded config
return config
@ -311,6 +312,12 @@ class ReticulumWebChat:
"app_data": parsed_app_data,
})))
# sets the app data for the lxmf destination to be the provided display name
def set_lxmf_display_name(self, display_name):
# could be called before destination is configured, so lets check it exists
if hasattr(self, "local_lxmf_destination"):
# set app data to display name
self.local_lxmf_destination.set_default_app_data(self.display_name.encode("utf-8"))
# an announce handler for lxmf.delivery aspect that just forwards to a provided callback
class LXMFAnnounceHandler: