handle nick changement in another resource. See #4826
This commit is contained in:
parent
3fab8db1b0
commit
3f5a2d9017
|
@ -1569,7 +1569,7 @@ class Interface:
|
|||
self.roster.add_contact(jid, account)
|
||||
else:
|
||||
# it is an existing contact that might has changed
|
||||
re_draw = False
|
||||
re_place = False
|
||||
# If contact has changed (sub, ask or group) update roster
|
||||
# Mind about observer status changes:
|
||||
# According to xep 0162, a contact is not an observer anymore when
|
||||
|
@ -1577,8 +1577,7 @@ class Interface:
|
|||
old_groups = contacts[0].groups
|
||||
if contacts[0].sub != sub or contacts[0].ask != ask\
|
||||
or old_groups != groups:
|
||||
re_draw = True
|
||||
if re_draw:
|
||||
re_place = True
|
||||
# c.get_shown_groups() has changed. Reflect that in roster_winodow
|
||||
self.roster.remove_contact(jid, account, force=True)
|
||||
for contact in contacts:
|
||||
|
@ -1586,11 +1585,13 @@ class Interface:
|
|||
contact.sub = sub
|
||||
contact.ask = ask
|
||||
contact.groups = groups or []
|
||||
if re_draw:
|
||||
if re_place:
|
||||
self.roster.add_contact(jid, account)
|
||||
# Refilter and update old groups
|
||||
for group in old_groups:
|
||||
self.roster.draw_group(group, account)
|
||||
else:
|
||||
self.roster.draw_contact(jid, account)
|
||||
|
||||
if self.remote_ctrl:
|
||||
self.remote_ctrl.raise_signal('RosterInfo', (account, array))
|
||||
|
|
Loading…
Reference in New Issue