changeset 3a8a6f07b98e in /home/hg/repos/gajim

branches: 
details:http://hg.gajim.org/gajim?cmd=changeset;node=3a8a6f07b98e
description: don't redraw roster line when it's not necessary

diffstat:

 src/gui_interface.py |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 0b2cacade877 -r 3a8a6f07b98e src/gui_interface.py
--- a/src/gui_interface.py      Mon Jul 15 16:03:07 2013 +0200
+++ b/src/gui_interface.py      Tue Jul 16 18:03:58 2013 +0200
@@ -788,21 +788,24 @@
                 # 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 []
-            self.roster.add_contact(obj.jid, account)
-            # Refilter and update old groups
-            for group in old_groups:
-                self.roster.draw_group(group, account)
-            self.roster.draw_contact(obj.jid, account)
+            if update:
+                self.roster.add_contact(obj.jid, account)
+                # Refilter and update old groups
+                for group in old_groups:
+                    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 (
         'from', 'both'):
             self.instances[account]['sub_request'][obj.jid].window.destroy()
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to