diff 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
line wrap: on
line diff
--- a/browser_side/contact.py	Fri Dec 27 13:59:06 2013 +0100
+++ b/browser_side/contact.py	Sun Dec 29 23:07:28 2013 +0100
@@ -270,14 +270,16 @@
                 # The group is now empty, we must remove it
                 del self.groups[group]
                 self._groupList.remove(group)
-                self.host.uni_box.removeKey(_key % group)
+                if self.host.uni_box:
+                    self.host.uni_box.removeKey(_key % group)
 
         for group in _new_groups.difference(_current_groups):
             # We add the contact to the groups he joined
             if not group in self.groups.keys():
                 self.groups[group] = set()
                 self._groupList.add(group)
-                self.host.uni_box.addKey(_key % group)
+                if self.host.uni_box:
+                    self.host.uni_box.addKey(_key % group)
             self.groups[group].add(jid)
 
         # We add the contact to contact list, it will check if contact already exists