diff 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
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_contact_list.py	Sat Apr 18 00:27:39 2015 +0200
+++ b/frontends/src/quick_frontend/quick_contact_list.py	Mon Apr 20 16:39:38 2015 +0200
@@ -175,7 +175,7 @@
 
                 if name == 'status':  # XXX: we get the first status for 'status' key
                     # TODO: manage main language for statuses
-                    return cache[C.PRESENCE_STATUSES].get('default', '')
+                    return cache[C.PRESENCE_STATUSES].get(C.PRESENCE_STATUSES_DEFAULT, '')
 
             return cache[name]
         except KeyError:
@@ -330,7 +330,7 @@
         else:
             alerts = {alert.bare for alert in self._alerts}
             selected = {selected.bare for selected in self._selected}
-        return ((show is not None and show != "unavailable")
+        return ((show is not None and show != C.PRESENCE_UNAVAILABLE)
                 or self.show_disconnected
                 or entity in alerts
                 or entity in selected)