summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-05-25 05:27:13 +0800
committerThom Nichols <tmnichols@gmail.com>2010-06-01 22:07:50 +0800
commit226b0e4297691d7f48124d0da1e9d851e836fd17 (patch)
tree6cf6ccea2b827f3431941bf436375f693247c0c6 /sleekxmpp
parent0b2cd176b18f3e94e5565c62a781d74fe92cb149 (diff)
downloadslixmpp-226b0e4297691d7f48124d0da1e9d851e836fd17.tar.gz
slixmpp-226b0e4297691d7f48124d0da1e9d851e836fd17.tar.bz2
slixmpp-226b0e4297691d7f48124d0da1e9d851e836fd17.tar.xz
slixmpp-226b0e4297691d7f48124d0da1e9d851e836fd17.zip
added plugin indexing to components
Diffstat (limited to 'sleekxmpp')
-rwxr-xr-xsleekxmpp/componentxmpp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py
index 9c7a6125..89953687 100755
--- a/sleekxmpp/componentxmpp.py
+++ b/sleekxmpp/componentxmpp.py
@@ -54,6 +54,16 @@ class ComponentXMPP(basexmpp, XMLStream):
self.secret = secret
self.registerHandler(Callback('Handshake', MatchXPath('{jabber:component:accept}handshake'), self._handleHandshake))
+ def __getitem__(self, key):
+ if key in self.plugin:
+ return self.plugin[key]
+ else:
+ logging.warning("""Plugin "%s" is not loaded.""" % key)
+ return False
+
+ def get(self, key, default):
+ return self.plugin.get(key, default)
+
def incoming_filter(self, xmlobj):
if xmlobj.tag.startswith('{jabber:client}'):
xmlobj.tag = xmlobj.tag.replace('jabber:client', self.default_ns)