re-announce local node if username changes
This commit is contained in:
parent
9d1603cfb2
commit
0b2db6fd80
1 changed files with 4 additions and 2 deletions
|
@ -70,7 +70,8 @@ class LocalNodes(dict):
|
||||||
|
|
||||||
def _update_if_ip_changed(self):
|
def _update_if_ip_changed(self):
|
||||||
local_ips = get_broadcast_interfaces()
|
local_ips = get_broadcast_interfaces()
|
||||||
if local_ips != self.local_ips:
|
username = settings.preferences.get('username', 'anonymous')
|
||||||
|
if local_ips != self.local_ips or self.username != username:
|
||||||
self.close()
|
self.close()
|
||||||
self.setup()
|
self.setup()
|
||||||
|
|
||||||
|
@ -88,8 +89,9 @@ class LocalNodes(dict):
|
||||||
|
|
||||||
local_name = socket.gethostname().partition('.')[0] + '.local.'
|
local_name = socket.gethostname().partition('.')[0] + '.local.'
|
||||||
port = settings.server['node_port']
|
port = settings.server['node_port']
|
||||||
|
self.username = settings.preferences.get('username', 'anonymous')
|
||||||
desc = {
|
desc = {
|
||||||
'username': settings.preferences.get('username', 'anonymous')
|
'username': self.username
|
||||||
}
|
}
|
||||||
self.local_info = []
|
self.local_info = []
|
||||||
for i, local_ip in enumerate(get_broadcast_interfaces()):
|
for i, local_ip in enumerate(get_broadcast_interfaces()):
|
||||||
|
|
Loading…
Reference in a new issue