Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 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 | 3265a2639182 |
children | b06047e1c1fb |
comparison
equal
deleted
inserted
replaced
1416:a419da93afef | 1417:176de79c8c39 |
---|---|
744 def onAboutRequest(self, menu): | 744 def onAboutRequest(self, menu): |
745 self.showPopUp(sat_widgets.Alert(_("About"), C.APP_NAME + " v" + self.bridge.getVersion(), ok_cb=self.removePopUp)) | 745 self.showPopUp(sat_widgets.Alert(_("About"), C.APP_NAME + " v" + self.bridge.getVersion(), ok_cb=self.removePopUp)) |
746 | 746 |
747 #MISC CALLBACKS# | 747 #MISC CALLBACKS# |
748 | 748 |
749 def setStatusOnline(self, online=True, show="", statuses={}, profile=C.PROF_KEY_NONE): | 749 def setPresenceStatus(self, show='', status=None, profile=C.PROF_KEY_NONE): |
750 if not online or not statuses: | 750 self.contact_lists[profile].status_bar.setPresenceStatus(show, status) |
751 self.contact_lists[profile].status_bar.setPresenceStatus(show if online else 'unavailable', '') | |
752 return | |
753 try: | |
754 self.contact_lists[profile].status_bar.setPresenceStatus(show, statuses['default']) | |
755 except (KeyError, TypeError): | |
756 pass | |
757 | 751 |
758 sat = PrimitivusApp() | 752 sat = PrimitivusApp() |
759 sat.start() | 753 sat.start() |