don't redraw roster line when it's not necessary
This commit is contained in:
parent
5a59654fea
commit
adb28aa5ce
1 changed files with 8 additions and 5 deletions
|
@ -788,21 +788,24 @@ class Interface:
|
||||||
# another of our instance removed a contact. Remove it here too
|
# another of our instance removed a contact. Remove it here too
|
||||||
self.roster.remove_contact(obj.jid, account, backend=True)
|
self.roster.remove_contact(obj.jid, account, backend=True)
|
||||||
return
|
return
|
||||||
|
update = False
|
||||||
if contacts[0].sub != obj.sub or contacts[0].ask != obj.ask\
|
if contacts[0].sub != obj.sub or contacts[0].ask != obj.ask\
|
||||||
or old_groups != obj.groups:
|
or old_groups != obj.groups:
|
||||||
# c.get_shown_groups() has changed. Reflect that in
|
# c.get_shown_groups() has changed. Reflect that in
|
||||||
# roster_window
|
# roster_window
|
||||||
self.roster.remove_contact(obj.jid, account, force=True)
|
self.roster.remove_contact(obj.jid, account, force=True)
|
||||||
|
update = True
|
||||||
for contact in contacts:
|
for contact in contacts:
|
||||||
contact.name = obj.nickname or ''
|
contact.name = obj.nickname or ''
|
||||||
contact.sub = obj.sub
|
contact.sub = obj.sub
|
||||||
contact.ask = obj.ask
|
contact.ask = obj.ask
|
||||||
contact.groups = obj.groups or []
|
contact.groups = obj.groups or []
|
||||||
self.roster.add_contact(obj.jid, account)
|
if update:
|
||||||
# Refilter and update old groups
|
self.roster.add_contact(obj.jid, account)
|
||||||
for group in old_groups:
|
# Refilter and update old groups
|
||||||
self.roster.draw_group(group, account)
|
for group in old_groups:
|
||||||
self.roster.draw_contact(obj.jid, account)
|
self.roster.draw_group(group, account)
|
||||||
|
self.roster.draw_contact(obj.jid, account)
|
||||||
if obj.jid in self.instances[account]['sub_request'] and obj.sub in (
|
if obj.jid in self.instances[account]['sub_request'] and obj.sub in (
|
||||||
'from', 'both'):
|
'from', 'both'):
|
||||||
self.instances[account]['sub_request'][obj.jid].window.destroy()
|
self.instances[account]['sub_request'][obj.jid].window.destroy()
|
||||||
|
|
Loading…
Add table
Reference in a new issue