comparison frontends/src/quick_frontend/quick_contact_list.py @ 1305:3dc7f61677bb frontends_multi_profiles

merged souliane commits
author Goffi <goffi@goffi.org>
date Fri, 06 Feb 2015 19:29:37 +0100
parents 447d28b1b4ec ef7e8e23b353
children 789e86a8919d
comparison
equal deleted inserted replaced
1304:1a61b18703c4 1305:3dc7f61677bb
80 try: 80 try:
81 return entity.resource in self.getCache(entity.bare, C.CONTACT_RESOURCES) 81 return entity.resource in self.getCache(entity.bare, C.CONTACT_RESOURCES)
82 except KeyError: 82 except KeyError:
83 return False 83 return False
84 return entity in self._cache 84 return entity in self._cache
85
86 @property
87 def roster_entities(self):
88 """Return all the bare JIDs of the roster entities.
89
90 @return: set(jid.JID)
91 """
92 return self._roster
93
94 @property
95 def roster_entities_by_group(self):
96 """Return a dictionary binding the roster groups to their entities bare JIDs.
97
98 @return: dict{unicode: set(jid.JID)}
99 """
100 return {group: self._groups[group]['jids'] for group in self._groups}
101
102 @property
103 def roster_groups_by_entity(self, contact_jid_s):
104 """Return a dictionary binding the entities bare JIDs to their roster groups.
105
106 @return: dict{jid.JID: set(unicode)}
107 """
108 result = {}
109 for group, data in self._groups.iteritems():
110 if group is None:
111 continue
112 for entity in data['jids']:
113 result.setdefault(entity, set()).add(group)
114 return result
85 115
86 def fill(self): 116 def fill(self):
87 """Get all contacts from backend, and fill the widget""" 117 """Get all contacts from backend, and fill the widget"""
88 def gotContacts(contacts): 118 def gotContacts(contacts):
89 for contact in contacts: 119 for contact in contacts: