summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 4d9a8964..7c131250 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -138,6 +138,17 @@ class BaseXMPP(XMLStream):
register_stanza_plugin(Message, Nick)
register_stanza_plugin(Message, HTMLIM)
+ def start_stream_handler(self, xml):
+ """
+ Save the stream ID once the streams have been established.
+
+ Overrides XMLStream.start_stream_handler.
+
+ Arguments:
+ xml -- The incoming stream's root element.
+ """
+ self.stream_id = xml.get('id', '')
+
def process(self, *args, **kwargs):
"""
Overrides XMLStream.process.
@@ -198,6 +209,10 @@ class BaseXMPP(XMLStream):
# the sleekxmpp package, so leave out the globals().
module = __import__(module, fromlist=[plugin])
+ # Use the global plugin config cache, if applicable
+ if not pconfig:
+ pconfig = self.plugin_config.get(plugin, {})
+
# Load the plugin class from the module.
self.plugin[plugin] = getattr(module, plugin)(self, pconfig)