summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2009-09-15 18:42:47 +0000
committerNathan Fritz <fritzy@netflint.net>2009-09-15 18:42:47 +0000
commite59d43ff3e07610b9cedbd04f64619fe9743694d (patch)
tree59c9fbf845216e6d64e058e469b2a302112a3315
parentcb360c94797252291e2016bdc655063dd4670c66 (diff)
downloadslixmpp-e59d43ff3e07610b9cedbd04f64619fe9743694d.tar.gz
slixmpp-e59d43ff3e07610b9cedbd04f64619fe9743694d.tar.bz2
slixmpp-e59d43ff3e07610b9cedbd04f64619fe9743694d.tar.xz
slixmpp-e59d43ff3e07610b9cedbd04f64619fe9743694d.zip
* fixed unavailable status in sendPresence
* fixed jabber:client filtering for components
-rw-r--r--sleekxmpp/basexmpp.py3
-rwxr-xr-xsleekxmpp/componentxmpp.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 965570ed..8985b546 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -297,6 +297,9 @@ class basexmpp(object):
return message
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)
if ptype:
presence.attrib['type'] = ptype
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py
index ad897586..dc80dd9f 100755
--- a/sleekxmpp/componentxmpp.py
+++ b/sleekxmpp/componentxmpp.py
@@ -73,8 +73,8 @@ class ComponentXMPP(basexmpp, XMLStream):
def incoming_filter(self, xmlobj):
if xmlobj.tag.startswith('{jabber:client}'):
xmlobj.tag = xmlobj.tag.replace('jabber:client', 'jabber:component:accept')
- for child in xmlobj.getchildren():
- child = self.incoming_filter(child)
+ for sub in xmlobj:
+ self.incoming_filter(sub)
return xmlobj