bridge, frontends: display presence with the highest priority + reset your own presence when you (dis)connect
This commit is contained in:
parent
005ec59a8a
commit
bc9efbda82
3 changed files with 39 additions and 20 deletions
|
|
@ -396,10 +396,10 @@ class DbusObject(dbus.service.Object):
|
|||
return self._callback("setParam", unicode(name), unicode(value), unicode(category), security_limit, unicode(profile_key))
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
in_signature='ssia{ss}s', out_signature='',
|
||||
in_signature='ssa{ss}s', out_signature='',
|
||||
async_callbacks=None)
|
||||
def setPresence(self, to_jid='', show='', priority=0, statuses={}, profile_key="@DEFAULT@"):
|
||||
return self._callback("setPresence", unicode(to_jid), unicode(show), priority, statuses, unicode(profile_key))
|
||||
def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"):
|
||||
return self._callback("setPresence", unicode(to_jid), unicode(show), statuses, unicode(profile_key))
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
in_signature='sss', out_signature='',
|
||||
|
|
|
|||
|
|
@ -357,19 +357,17 @@ doc_param_5=%(doc_profile_key)s
|
|||
[setPresence]
|
||||
type=method
|
||||
category=core
|
||||
sig_in=ssia{ss}s
|
||||
sig_in=ssa{ss}s
|
||||
sig_out=
|
||||
param_0_default=''
|
||||
param_1_default=''
|
||||
param_2_default=0
|
||||
param_3_default={}
|
||||
param_4_default="@DEFAULT@"
|
||||
param_2_default={}
|
||||
param_3_default="@DEFAULT@"
|
||||
doc=Set presence information for the profile
|
||||
doc_param_0=to_jid: the JID to who we send the presence data (emtpy string for broadcast)
|
||||
doc_param_1=show: as for [presenceUpdate]
|
||||
doc_param_2=priority: as for [presenceUpdate]
|
||||
doc_param_3=statuses: as for [presenceUpdate]
|
||||
doc_param_4=%(doc_profile_key)s
|
||||
doc_param_2=statuses: as for [presenceUpdate]
|
||||
doc_param_3=%(doc_profile_key)s
|
||||
|
||||
[subscription]
|
||||
type=method
|
||||
|
|
|
|||
|
|
@ -574,15 +574,16 @@ class SAT(service.Service):
|
|||
extra=mess_data['extra'],
|
||||
profile=profile)
|
||||
|
||||
def _setPresence(self, to="", show="", priority=0, statuses=None, profile_key=C.PROF_KEY_NONE):
|
||||
return self.setPresence(jid.JID(to) if to else None, show, priority, statuses, profile_key)
|
||||
def _setPresence(self, to="", show="", statuses=None, profile_key=C.PROF_KEY_NONE):
|
||||
return self.setPresence(jid.JID(to) if to else None, show, statuses, profile_key)
|
||||
|
||||
def setPresence(self, to_jid=None, show="", priority=0, statuses=None, profile_key=C.PROF_KEY_NONE):
|
||||
def setPresence(self, to_jid=None, show="", statuses=None, profile_key=C.PROF_KEY_NONE):
|
||||
"""Send our presence information"""
|
||||
if statuses is None:
|
||||
statuses = {}
|
||||
profile = self.memory.getProfileName(profile_key)
|
||||
assert(profile)
|
||||
priority = int(self.memory.getParamA("Priority", "Connection", profile_key=profile))
|
||||
self.profiles[profile].presence.available(to_jid, show, statuses, priority)
|
||||
#XXX: FIXME: temporary fix to work around openfire 3.7.0 bug (presence is not broadcasted to generating resource)
|
||||
if '' in statuses:
|
||||
|
|
|
|||
Loading…
Reference in a new issue