diff frontends/quick_frontend/quick_contact_management.py @ 54:2ce9e350cdf9

Wix: clicking on group in contact_list now (un)hide it. Quick App: added a method to get all contacts in a group in contact_management
author Goffi <goffi@goffi.org>
date Sun, 10 Jan 2010 17:25:43 +1100
parents 6455fb62ff83
children 01ea5680207e
line wrap: on
line diff
--- a/frontends/quick_frontend/quick_contact_management.py	Sun Jan 10 16:42:09 2010 +1100
+++ b/frontends/quick_frontend/quick_contact_management.py	Sun Jan 10 17:25:43 2010 +1100
@@ -42,7 +42,16 @@
         if entity.resource in self.__contactlist[entity.short]['resources']:
             self.__contactlist[entity.short]['resources'].remove(entity.resource)
         self.__contactlist[entity.short]['resources'].append(entity.resource)
-    
+   
+    def getContFromGroup(self, group):
+        """Return all contacts which are in given group"""
+        result = []
+        for contact in self.__contactlist:
+            if self.__contactlist[contact].has_key('groups'):
+                if group in self.__contactlist[contact]['groups']:
+                    result.append(JID(contact))
+        return result
+
     def getAttr(self, entity, name):
         """Return a specific attribute of contact, or all attributes
         @param entity: jid of the contact