prevent adding twice a group in a contact.groups

This commit is contained in:
Yann Leboulanger 2006-03-29 18:07:58 +00:00
parent c5e0650c91
commit 12959a7888
1 changed files with 5 additions and 4 deletions

View File

@ -104,10 +104,11 @@ class EditGroupsDialog:
self.changes_made = True
model = self.list.get_model()
model[path][1] = not model[path][1]
if model[path][1]:
self.user.groups.append(model[path][0].decode('utf-8'))
else:
self.user.groups.remove(model[path][0].decode('utf-8'))
jid = model[path][0].decode('utf-8')
if model[path][1] and not jid in self.user.groups:
self.user.groups.append(jid)
elif jid in self.user.groups:
self.user.groups.remove(jid)
self.update_contact()
def init_list(self):