frontends: set and retrieve your own presence and status

This commit is contained in:
souliane 2013-11-25 01:56:07 +01:00
commit 4d393d47c0

View file

@ -294,12 +294,13 @@ class QuickApp(object):
assert alert_type in ['INFO','ERROR']
self.showDialog(unicode(msg),unicode(title),alert_type.lower())
def setStatusOnline(self, online=True):
pass
def setStatusOnline(self, online=True, show="", statuses={}):
raise NotImplementedError
def presenceUpdate(self, jabber_id, show, priority, statuses, profile):
if not self.check_profile(profile):
return
debug(_("presence update for %(jid)s (show=%(show)s, priority=%(priority)s, statuses=%(statuses)s) [profile:%(profile)s]")
% {'jid': jabber_id, 'show': show, 'priority': priority, 'statuses': statuses, 'profile': profile})
from_jid = JID(jabber_id)
@ -309,7 +310,7 @@ class QuickApp(object):
if show == "unavailable":
self.setStatusOnline(False)
else:
self.setStatusOnline(True)
self.setStatusOnline(True, show, statuses)
return
self.contact_list.updatePresence(from_jid, show, priority, statuses)