mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
* fixed unavailable status in sendPresence
* fixed jabber:client filtering for components
This commit is contained in:
parent
cb360c9479
commit
e59d43ff3e
2 changed files with 5 additions and 2 deletions
|
@ -297,6 +297,9 @@ class basexmpp(object):
|
||||||
return message
|
return message
|
||||||
|
|
||||||
def makePresence(self, pshow=None, pstatus=None, ppriority=None, pto=None, ptype=None, pfrom=None):
|
def makePresence(self, pshow=None, pstatus=None, ppriority=None, pto=None, ptype=None, pfrom=None):
|
||||||
|
if pshow == 'unavailable':
|
||||||
|
pshow = None
|
||||||
|
ptype = 'unavailable'
|
||||||
presence = ET.Element('{%s}presence' % self.default_ns)
|
presence = ET.Element('{%s}presence' % self.default_ns)
|
||||||
if ptype:
|
if ptype:
|
||||||
presence.attrib['type'] = ptype
|
presence.attrib['type'] = ptype
|
||||||
|
|
|
@ -73,8 +73,8 @@ class ComponentXMPP(basexmpp, XMLStream):
|
||||||
def incoming_filter(self, xmlobj):
|
def incoming_filter(self, xmlobj):
|
||||||
if xmlobj.tag.startswith('{jabber:client}'):
|
if xmlobj.tag.startswith('{jabber:client}'):
|
||||||
xmlobj.tag = xmlobj.tag.replace('jabber:client', 'jabber:component:accept')
|
xmlobj.tag = xmlobj.tag.replace('jabber:client', 'jabber:component:accept')
|
||||||
for child in xmlobj.getchildren():
|
for sub in xmlobj:
|
||||||
child = self.incoming_filter(child)
|
self.incoming_filter(sub)
|
||||||
return xmlobj
|
return xmlobj
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue