summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0107/user_mood.py
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 /sleekxmpp/plugins/xep_0107/user_mood.py
parent67972c5e8496864e2297f5820e4034734996479b (diff)
downloadslixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.tar.gz
slixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.tar.bz2
slixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.tar.xz
slixmpp-14d4062f4afe961e3dccf8eec7ef84ec22512fca.zip
Move XEP-0107 to new system.
Diffstat (limited to 'sleekxmpp/plugins/xep_0107/user_mood.py')
-rw-r--r--sleekxmpp/plugins/xep_0107/user_mood.py23
1 files changed, 8 insertions, 15 deletions
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):