changeset 3ba775fbc884 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=3ba775fbc884
description: correctly add contacts to roster when we get a roster set <iq>, even in case we have a Contact instance already. Fixes #5595
diffstat:
src/gui_interface.py | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diffs (39 lines):
diff -r 84d5061176fc -r 3ba775fbc884 src/gui_interface.py
--- a/src/gui_interface.py Wed Mar 24 21:30:05 2010 +0000
+++ b/src/gui_interface.py Thu Mar 25 07:50:32 2010 +0100
@@ -1250,8 +1250,6 @@
gajim.contacts.add_contact(account, contact)
self.roster.add_contact(jid, account)
else:
- # it is an existing contact that might has changed
- 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
@@ -1259,7 +1257,6 @@
old_groups = contacts[0].groups
if contacts[0].sub != sub or contacts[0].ask != ask\
or old_groups != groups:
- re_place = True
# c.get_shown_groups() has changed. Reflect that in
# roster_winodow
self.roster.remove_contact(jid, account, force=True)
@@ -1268,13 +1265,11 @@
contact.sub = sub
contact.ask = ask
contact.groups = groups or []
- 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)
+ self.roster.add_contact(jid, account)
+ # Refilter and update old groups
+ for group in old_groups:
+ self.roster.draw_group(group, account)
+ self.roster.draw_contact(jid, account)
if self.remote_ctrl:
self.remote_ctrl.raise_signal('RosterInfo', (account, array))