summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 19:11:00 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:20 -0700
commit14d4062f4afe961e3dccf8eec7ef84ec22512fca (patch)
treec7be9f4b960ed9efea80c241213812e24ac69baa
parent67972c5e8496864e2297f5820e4034734996479b (diff)
downloadslixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.tar.gz
slixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.tar.bz2
slixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.tar.xz
slixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.zip
Move XEP-0107 to new system.
-rw-r--r--sleekxmpp/plugins/xep_0107/__init__.py7
-rw-r--r--sleekxmpp/plugins/xep_0107/user_mood.py23
2 files changed, 14 insertions, 16 deletions
diff --git a/sleekxmpp/plugins/xep_0107/__init__.py b/sleekxmpp/plugins/xep_0107/__init__.py
index e1c5eacf..04302df8 100644
--- a/sleekxmpp/plugins/xep_0107/__init__.py
+++ b/sleekxmpp/plugins/xep_0107/__init__.py
@@ -6,6 +6,11 @@
See the file LICENSE for copying permission.
"""
+from sleekxmpp.plugins.base import register_plugin
+
from sleekxmpp.plugins.xep_0107 import stanza
from sleekxmpp.plugins.xep_0107.stanza import UserMood
-from sleekxmpp.plugins.xep_0107.user_mood import xep_0107
+from sleekxmpp.plugins.xep_0107.user_mood import XEP_0107
+
+
+register_plugin(XEP_0107)
diff --git a/sleekxmpp/plugins/xep_0107/user_mood.py b/sleekxmpp/plugins/xep_0107/user_mood.py
index 37749b4b..11aaace4 100644
--- a/sleekxmpp/plugins/xep_0107/user_mood.py
+++ b/sleekxmpp/plugins/xep_0107/user_mood.py
@@ -12,34 +12,27 @@ from sleekxmpp import Message
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import MatchXPath
-from sleekxmpp.plugins.base import base_plugin
+from sleekxmpp.plugins.base import BasePlugin
from sleekxmpp.plugins.xep_0107 import stanza, UserMood
log = logging.getLogger(__name__)
-class xep_0107(base_plugin):
+class XEP_0107(BasePlugin):
"""
XEP-0107: User Mood
"""
- def plugin_init(self):
- self.xep = '0107'
- self.description = 'User Mood'
- self.stanza = stanza
-
- def post_init(self):
- base_plugin.post_init(self)
+ name = 'xep_0107'
+ description = 'XEP-0107: User Mood'
+ dependencies = set(['xep_0163'])
+ stanza = stanza
- pubsub_stanza = self.xmpp['xep_0060'].stanza
+ def plugin_init(self):
register_stanza_plugin(Message, UserMood)
- register_stanza_plugin(pubsub_stanza.EventItem, UserMood)
-
- self.xmpp['xep_0030'].add_feature(UserMood.namespace)
- self.xmpp['xep_0163'].add_interest(UserMood.namespace)
- self.xmpp['xep_0060'].map_node_event(UserMood.namespace, 'user_mood')
+ self.xmpp['xep_0163'].register_pep('user_mood', UserMood)
def publish_mood(self, value=None, text=None, options=None,
ifrom=None, block=True, callback=None, timeout=None):