mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-23 19:19:53 +00:00
If no config for a plugin is given, try using self.plugin_config.
Sleek loads a few plugins by default, which made it difficult to configure or even disable them. Now, if a plugin is registered without any configuration, then sleek will try finding a configuration in self.plugin_config.
This commit is contained in:
parent
6c4cb2bf00
commit
5be5b8c02b
1 changed files with 4 additions and 0 deletions
|
@ -198,6 +198,10 @@ class BaseXMPP(XMLStream):
|
||||||
# the sleekxmpp package, so leave out the globals().
|
# the sleekxmpp package, so leave out the globals().
|
||||||
module = __import__(module, fromlist=[plugin])
|
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.
|
# Load the plugin class from the module.
|
||||||
self.plugin[plugin] = getattr(module, plugin)(self, pconfig)
|
self.plugin[plugin] = getattr(module, plugin)(self, pconfig)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue