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
This commit is contained in:
parent
e4cb7f59d3
commit
41b549f7ae
1 changed files with 30 additions and 38 deletions
|
|
@ -746,14 +746,8 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
|
||||
#MISC CALLBACKS#
|
||||
|
||||
def setStatusOnline(self, online=True, show="", statuses={}, profile=C.PROF_KEY_NONE):
|
||||
if not online or not statuses:
|
||||
self.contact_lists[profile].status_bar.setPresenceStatus(show if online else 'unavailable', '')
|
||||
return
|
||||
try:
|
||||
self.contact_lists[profile].status_bar.setPresenceStatus(show, statuses['default'])
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
def setPresenceStatus(self, show='', status=None, profile=C.PROF_KEY_NONE):
|
||||
self.contact_lists[profile].status_bar.setPresenceStatus(show, status)
|
||||
|
||||
sat = PrimitivusApp()
|
||||
sat.start()
|
||||
|
|
|
|||
Loading…
Reference in a new issue