summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-05-24 14:27:13 -0700
committerNathan Fritz <nathan@andyet.net>2010-05-24 14:27:13 -0700
commit3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb (patch)
tree47c84ffda15050163607ca0b34c300e6454c516b
parentfeaa7539affa9a451b568b5b1502630cd3833ca3 (diff)
downloadslixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.tar.gz
slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.tar.bz2
slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.tar.xz
slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.zip
added plugin indexing to components
-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)