summaryrefslogtreecommitdiff
path: root/sleekxmpp/componentxmpp.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/componentxmpp.py')
-rw-r--r--sleekxmpp/componentxmpp.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py
index 20748b69..4b229a6f 100644
--- a/sleekxmpp/componentxmpp.py
+++ b/sleekxmpp/componentxmpp.py
@@ -49,8 +49,13 @@ class ComponentXMPP(BaseXMPP):
Defaults to ``False``.
"""
- def __init__(self, jid, secret, host=None, port=None,
- plugin_config={}, plugin_whitelist=[], use_jc_ns=False):
+ def __init__(self, jid, secret, host=None, port=None, plugin_config=None, plugin_whitelist=None, use_jc_ns=False):
+
+ if not plugin_whitelist:
+ plugin_whitelist = []
+ if not plugin_config:
+ plugin_config = {}
+
if use_jc_ns:
default_ns = 'jabber:client'
else:
@@ -123,12 +128,6 @@ class ComponentXMPP(BaseXMPP):
"""
if xml.tag.startswith('{jabber:client}'):
xml.tag = xml.tag.replace('jabber:client', self.default_ns)
-
- # The incoming_filter call is only made on top level stanza
- # elements. So we manually continue filtering on sub-elements.
- for sub in xml:
- self.incoming_filter(sub)
-
return xml
def start_stream_handler(self, xml):
@@ -158,10 +157,8 @@ class ComponentXMPP(BaseXMPP):
"""
self.session_bind_event.set()
self.session_started_event.set()
- self.event("session_bind", self.xmpp.boundjid.full, direct=True)
- self.event("session_start")
+ self.event('session_bind', self.boundjid, direct=True)
+ self.event('session_start')
- def _handle_probe(self, presence):
- pto = presence['to'].bare
- pfrom = presence['from'].bare
- self.roster[pto][pfrom].handle_probe(presence)
+ def _handle_probe(self, pres):
+ self.roster[pres['to']][pres['from']].handle_probe(pres)