From 14d4062f4afe961e3dccf8eec7ef84ec22512fca Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 12 Mar 2012 19:11:00 -0700 Subject: Move XEP-0107 to new system. --- sleekxmpp/plugins/xep_0107/user_mood.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'sleekxmpp/plugins/xep_0107/user_mood.py') 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): -- cgit v1.2.3