comparison 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
comparison
equal deleted inserted replaced
53:6dfe5bb10008 54:2ce9e350cdf9
40 if not self.__contactlist.has_key(entity.short): 40 if not self.__contactlist.has_key(entity.short):
41 self.__contactlist[entity.short] = {'resources':[]} 41 self.__contactlist[entity.short] = {'resources':[]}
42 if entity.resource in self.__contactlist[entity.short]['resources']: 42 if entity.resource in self.__contactlist[entity.short]['resources']:
43 self.__contactlist[entity.short]['resources'].remove(entity.resource) 43 self.__contactlist[entity.short]['resources'].remove(entity.resource)
44 self.__contactlist[entity.short]['resources'].append(entity.resource) 44 self.__contactlist[entity.short]['resources'].append(entity.resource)
45 45
46 def getContFromGroup(self, group):
47 """Return all contacts which are in given group"""
48 result = []
49 for contact in self.__contactlist:
50 if self.__contactlist[contact].has_key('groups'):
51 if group in self.__contactlist[contact]['groups']:
52 result.append(JID(contact))
53 return result
54
46 def getAttr(self, entity, name): 55 def getAttr(self, entity, name):
47 """Return a specific attribute of contact, or all attributes 56 """Return a specific attribute of contact, or all attributes
48 @param entity: jid of the contact 57 @param entity: jid of the contact
49 @param name: name of the attribute 58 @param name: name of the attribute
50 @return: asked attribute""" 59 @return: asked attribute"""