mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-12-24 03:00:17 +00:00
added plugin indexing to components
This commit is contained in:
parent
0b2cd176b1
commit
226b0e4297
1 changed files with 10 additions and 0 deletions
|
@ -54,6 +54,16 @@ class ComponentXMPP(basexmpp, XMLStream):
|
||||||
self.secret = secret
|
self.secret = secret
|
||||||
self.registerHandler(Callback('Handshake', MatchXPath('{jabber:component:accept}handshake'), self._handleHandshake))
|
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):
|
def incoming_filter(self, xmlobj):
|
||||||
if xmlobj.tag.startswith('{jabber:client}'):
|
if xmlobj.tag.startswith('{jabber:client}'):
|
||||||
xmlobj.tag = xmlobj.tag.replace('jabber:client', self.default_ns)
|
xmlobj.tag = xmlobj.tag.replace('jabber:client', self.default_ns)
|
||||||
|
|
Loading…
Reference in a new issue