don't redraw roster line when it's not necessary

This commit is contained in:
Yann Leboulanger 2013-07-16 18:03:58 +02:00
parent 3b4075c7c4
commit 8fe892a068
1 changed files with 8 additions and 5 deletions

View File

@ -788,16 +788,19 @@ class Interface:
# another of our instance removed a contact. Remove it here too
self.roster.remove_contact(obj.jid, account, backend=True)
return
update = False
if contacts[0].sub != obj.sub or contacts[0].ask != obj.ask\
or old_groups != obj.groups:
# c.get_shown_groups() has changed. Reflect that in
# roster_window
self.roster.remove_contact(obj.jid, account, force=True)
update = True
for contact in contacts:
contact.name = obj.nickname or ''
contact.sub = obj.sub
contact.ask = obj.ask
contact.groups = obj.groups or []
if update:
self.roster.add_contact(obj.jid, account)
# Refilter and update old groups
for group in old_groups: