summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 00:36:48 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:20 -0700
commit64c46562d3dce376fe7c6a1462328531d4661960 (patch)
tree85267c098ae116018c996ca13825069d94d7786b /sleekxmpp/plugins
parent87d6ade06d0c51245e2dc4292f5dfb802f98d453 (diff)
downloadslixmpp-64c46562d3dce376fe7c6a1462328531d4661960.tar.gz
slixmpp-64c46562d3dce376fe7c6a1462328531d4661960.tar.bz2
slixmpp-64c46562d3dce376fe7c6a1462328531d4661960.tar.xz
slixmpp-64c46562d3dce376fe7c6a1462328531d4661960.zip
Move XEP-0249 to the new system.
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0249/__init__.py11
-rw-r--r--sleekxmpp/plugins/xep_0249/invite.py17
2 files changed, 18 insertions, 10 deletions
diff --git a/sleekxmpp/plugins/xep_0249/__init__.py b/sleekxmpp/plugins/xep_0249/__init__.py
index e88d87ac..b85f55ce 100644
--- a/sleekxmpp/plugins/xep_0249/__init__.py
+++ b/sleekxmpp/plugins/xep_0249/__init__.py
@@ -6,5 +6,14 @@
See the file LICENSE for copying permission.
"""
+from sleekxmpp.plugins.base import register_plugin
+
from sleekxmpp.plugins.xep_0249.stanza import Invite
-from sleekxmpp.plugins.xep_0249.invite import xep_0249
+from sleekxmpp.plugins.xep_0249.invite import XEP_0249
+
+
+register_plugin(XEP_0249)
+
+
+# Retain some backwards compatibility
+xep_0249 = XEP_0249
diff --git a/sleekxmpp/plugins/xep_0249/invite.py b/sleekxmpp/plugins/xep_0249/invite.py
index 95fcb37c..737684f5 100644
--- a/sleekxmpp/plugins/xep_0249/invite.py
+++ b/sleekxmpp/plugins/xep_0249/invite.py
@@ -10,27 +10,28 @@ import logging
import sleekxmpp
from sleekxmpp import Message
-from sleekxmpp.plugins.base import base_plugin
+from sleekxmpp.plugins import BasePlugin
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import StanzaPath
-from sleekxmpp.plugins.xep_0249 import Invite
+from sleekxmpp.plugins.xep_0249 import Invite, stanza
log = logging.getLogger(__name__)
-class xep_0249(base_plugin):
+class XEP_0249(BasePlugin):
"""
XEP-0249: Direct MUC Invitations
"""
- def plugin_init(self):
- self.xep = "0249"
- self.description = "Direct MUC Invitations"
- self.stanza = sleekxmpp.plugins.xep_0249.stanza
+ name = 'xep_0249'
+ description = 'XEP-0249: Direct MUC Invitations'
+ dependencies = set(['xep_0030'])
+ stanza = stanza
+ def plugin_init(self):
self.xmpp.register_handler(
Callback('Direct MUC Invitations',
StanzaPath('message/groupchat_invite'),
@@ -38,8 +39,6 @@ class xep_0249(base_plugin):
register_stanza_plugin(Message, Invite)
- def post_init(self):
- base_plugin.post_init(self)
self.xmpp['xep_0030'].add_feature(Invite.namespace)
def _handle_invite(self, msg):