diff --git a/frontends/quick_frontend/quick_contact_management.py b/frontends/quick_frontend/quick_contact_management.py index 388f16f3..a9e88752 100644 --- a/frontends/quick_frontend/quick_contact_management.py +++ b/frontends/quick_frontend/quick_contact_management.py @@ -42,7 +42,16 @@ class QuickContactManagement(): 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 diff --git a/frontends/wix/main_window.py b/frontends/wix/main_window.py index 291c04b3..e794575b 100644 --- a/frontends/wix/main_window.py +++ b/frontends/wix/main_window.py @@ -79,7 +79,7 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList): self.Bind(wx.EVT_LISTBOX_DCLICK, self.onActivated) def __find_idx(self, entity, reverse=False): - """Find indexes of given jid in contact list + """Find indexes of given jid (or groups) in contact list @return: list of indexes""" result=[] for i in range(self.GetCount()): @@ -98,10 +98,23 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList): def disconnect(self, jid): self.remove(jid) #for now, we only show online contacts + + def __eraseGroup(self, group): + """Erase all contacts in group + @param group: group to erase + @return: True if something as been erased""" + erased = False + indexes = self.__find_idx(group) + for idx in indexes: + while idx