summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 9728c3f4..c9439ea3 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -16,6 +16,7 @@ from . xmlstream.handler.xmlcallback import XMLCallback
from . xmlstream.handler.xmlwaiter import XMLWaiter
from . xmlstream.handler.waiter import Waiter
from . xmlstream.handler.callback import Callback
+from . xmlstream.stanzabase import registerStanzaPlugin
from . import plugins
from . stanza.message import Message
from . stanza.iq import Iq
@@ -35,12 +36,6 @@ if sys.version_info < (3,0):
reload(sys)
sys.setdefaultencoding('utf8')
-
-def stanzaPlugin(stanza, plugin):
- stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
- stanza.plugin_tag_map["{%s}%s" % (plugin.namespace, plugin.name)] = plugin
-
-
class basexmpp(object):
def __init__(self):
self.id = 0
@@ -62,13 +57,9 @@ class basexmpp(object):
self.registerStanza(Message)
self.registerStanza(Iq)
self.registerStanza(Presence)
- self.stanzaPlugin(Iq, Roster)
- self.stanzaPlugin(Message, Nick)
- self.stanzaPlugin(Message, HTMLIM)
-
- def stanzaPlugin(self, stanza, plugin):
- stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
- stanza.plugin_tag_map["{%s}%s" % (plugin.namespace, plugin.name)] = plugin
+ registerStanzaPlugin(Iq, Roster)
+ registerStanzaPlugin(Message, Nick)
+ registerStanzaPlugin(Message, HTMLIM)
def Message(self, *args, **kwargs):
return Message(self, *args, **kwargs)