comparison browser_side/contact.py @ 309:05e264e96a1c

browser_side: make unibox optional
author souliane <souliane@mailoo.org>
date Sun, 29 Dec 2013 23:07:28 +0100
parents 2ab513a47e3b
children 0b7934e75e76
comparison
equal deleted inserted replaced
308:0ca441ba4317 309:05e264e96a1c
268 self.groups[group].remove(jid) 268 self.groups[group].remove(jid)
269 if not self.groups[group]: 269 if not self.groups[group]:
270 # The group is now empty, we must remove it 270 # The group is now empty, we must remove it
271 del self.groups[group] 271 del self.groups[group]
272 self._groupList.remove(group) 272 self._groupList.remove(group)
273 self.host.uni_box.removeKey(_key % group) 273 if self.host.uni_box:
274 self.host.uni_box.removeKey(_key % group)
274 275
275 for group in _new_groups.difference(_current_groups): 276 for group in _new_groups.difference(_current_groups):
276 # We add the contact to the groups he joined 277 # We add the contact to the groups he joined
277 if not group in self.groups.keys(): 278 if not group in self.groups.keys():
278 self.groups[group] = set() 279 self.groups[group] = set()
279 self._groupList.add(group) 280 self._groupList.add(group)
280 self.host.uni_box.addKey(_key % group) 281 if self.host.uni_box:
282 self.host.uni_box.addKey(_key % group)
281 self.groups[group].add(jid) 283 self.groups[group].add(jid)
282 284
283 # We add the contact to contact list, it will check if contact already exists 285 # We add the contact to contact list, it will check if contact already exists
284 self._contact_list.add(jid) 286 self._contact_list.add(jid)
285 287