summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2011-08-12 16:36:03 -0700
committerNathan Fritz <fritzy@netflint.net>2011-08-12 16:36:03 -0700
commit8f1d0e7a79b662e5f2849cea6e73716cc887e226 (patch)
treeec2fe16b50effd4ba5787a57de00c514fad4f333 /sleekxmpp/basexmpp.py
parent88184ff9556774b1be3dc7fcb97f1f71803d2d61 (diff)
parent9b7ed73f95145f88887d6fc3daa1bd2a9596b943 (diff)
downloadslixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.tar.gz
slixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.tar.bz2
slixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.tar.xz
slixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
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)