Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_contact_list.py @ 1417:176de79c8c39
core, plugin XEP-0045, frontends: change frontend method "setStatusOnline" for "setPresenceStatus":
- remove parameter "online" (can be guess from "presence" value)
- process "statuses" dict in quick_frontend, so this method can get a simple unicode "status"
- add C.PRESENCE_STATUSES_DEFAULT to define the key to use for fallback status
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 20 Apr 2015 16:39:38 +0200 |
parents | e2e75c3c7c7b |
children | 0e518415d03a |
comparison
equal
deleted
inserted
replaced
1416:a419da93afef | 1417:176de79c8c39 |
---|---|
173 else: | 173 else: |
174 cache = cache[C.CONTACT_RESOURCES][entity.resource] | 174 cache = cache[C.CONTACT_RESOURCES][entity.resource] |
175 | 175 |
176 if name == 'status': # XXX: we get the first status for 'status' key | 176 if name == 'status': # XXX: we get the first status for 'status' key |
177 # TODO: manage main language for statuses | 177 # TODO: manage main language for statuses |
178 return cache[C.PRESENCE_STATUSES].get('default', '') | 178 return cache[C.PRESENCE_STATUSES].get(C.PRESENCE_STATUSES_DEFAULT, '') |
179 | 179 |
180 return cache[name] | 180 return cache[name] |
181 except KeyError: | 181 except KeyError: |
182 return None | 182 return None |
183 | 183 |
328 alerts = self._alerts | 328 alerts = self._alerts |
329 selected = self._selected | 329 selected = self._selected |
330 else: | 330 else: |
331 alerts = {alert.bare for alert in self._alerts} | 331 alerts = {alert.bare for alert in self._alerts} |
332 selected = {selected.bare for selected in self._selected} | 332 selected = {selected.bare for selected in self._selected} |
333 return ((show is not None and show != "unavailable") | 333 return ((show is not None and show != C.PRESENCE_UNAVAILABLE) |
334 or self.show_disconnected | 334 or self.show_disconnected |
335 or entity in alerts | 335 or entity in alerts |
336 or entity in selected) | 336 or entity in selected) |
337 | 337 |
338 def anyEntityToShow(self, entities, check_resources=False): | 338 def anyEntityToShow(self, entities, check_resources=False): |