quick frontend (contact list): use property to retrieve "whoami" in ProfileContactList:
this avoid a crash introduced by early creation of contact list during profile plugging, and avoid desynchronisation risk.
This commit is contained in:
parent
154ba0d349
commit
867f58cd4e
1 changed files with 4 additions and 3 deletions
|
|
@ -83,9 +83,6 @@ class ProfileContactList(object):
|
||||||
# selected entities, full jid
|
# selected entities, full jid
|
||||||
self._selected = set()
|
self._selected = set()
|
||||||
|
|
||||||
# we keep our own jid
|
|
||||||
self.whoami = self.host.profiles[profile].whoami
|
|
||||||
|
|
||||||
# options
|
# options
|
||||||
self.show_disconnected = False
|
self.show_disconnected = False
|
||||||
self.show_empty_groups = True
|
self.show_empty_groups = True
|
||||||
|
|
@ -122,6 +119,10 @@ class ProfileContactList(object):
|
||||||
# notifListener only update the entity, so we can re-use it
|
# notifListener only update the entity, so we can re-use it
|
||||||
self.host.addListener("notificationsClear", self.notifListener, [self.profile])
|
self.host.addListener("notificationsClear", self.notifListener, [self.profile])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def whoami(self):
|
||||||
|
return self.host.profiles[self.profile].whoami
|
||||||
|
|
||||||
def _showEmptyGroups(self, show_str):
|
def _showEmptyGroups(self, show_str):
|
||||||
# Called only by __init__
|
# Called only by __init__
|
||||||
# self.update is not wanted here, as it is done by
|
# self.update is not wanted here, as it is done by
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue