summaryrefslogtreecommitdiff
path: root/sleekxmpp/componentxmpp.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2009-07-11 21:46:31 +0000
committerNathan Fritz <fritzy@netflint.net>2009-07-11 21:46:31 +0000
commit7a15d14c939dbc9ecc9822c81da55bdb648dcbdb (patch)
treef541753dbd8e2cb728bbe2aec39879e6e6c7f464 /sleekxmpp/componentxmpp.py
parent171bb30e83b54d9e93c7f5a9834050a02d2ecf70 (diff)
downloadslixmpp-7a15d14c939dbc9ecc9822c81da55bdb648dcbdb.tar.gz
slixmpp-7a15d14c939dbc9ecc9822c81da55bdb648dcbdb.tar.bz2
slixmpp-7a15d14c939dbc9ecc9822c81da55bdb648dcbdb.tar.xz
slixmpp-7a15d14c939dbc9ecc9822c81da55bdb648dcbdb.zip
added incoming_filter
Diffstat (limited to 'sleekxmpp/componentxmpp.py')
-rwxr-xr-xsleekxmpp/componentxmpp.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py
index 8eaa1408..33514859 100755
--- a/sleekxmpp/componentxmpp.py
+++ b/sleekxmpp/componentxmpp.py
@@ -23,14 +23,6 @@ from __future__ import absolute_import
from . basexmpp import basexmpp
from xml.etree import cElementTree as ET
-# some servers use different namespaces for components -- this is a hack, but is there for compatibility
-from . xmlstream.matcher import xmlmask
-from . xmlstream.matcher import xpath
-
-xmlmask.ignore_ns = True
-xpath.ignore_ns = True
-# ----------
-
from . xmlstream.xmlstream import XMLStream
from . xmlstream.xmlstream import RestartStream
from . xmlstream.matcher.xmlmask import MatchXMLMask
@@ -77,6 +69,14 @@ class ComponentXMPP(basexmpp, XMLStream):
MatchXMLMask("<presence xmlns='%s' type='unsubscribe'/>" % self.default_ns), \
MatchXMLMask("<presence xmlns='%s' type='unsubscribed'/>" % self.default_ns) \
)), self._handlePresenceSubscription))
+
+ 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.children():
+ child = self.incoming_filter(child)
+ return xmlobj
+
def _handlePresenceProbe(self, stanza):
xml = stanza.xml