summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0172/user_nick.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 19:30:49 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:20 -0700
commit5a2cbbb731eb3efd15f095789eefed5a4b05b532 (patch)
tree4f0c913c24f94270339618a254c27e068254dd32 /sleekxmpp/plugins/xep_0172/user_nick.py
parent32d6f856498dadaa0d7b1e01c9c83bd820d8767b (diff)
downloadslixmpp-5a2cbbb731eb3efd15f095789eefed5a4b05b532.tar.gz
slixmpp-5a2cbbb731eb3efd15f095789eefed5a4b05b532.tar.bz2
slixmpp-5a2cbbb731eb3efd15f095789eefed5a4b05b532.tar.xz
slixmpp-5a2cbbb731eb3efd15f095789eefed5a4b05b532.zip
Move XEP-0172 to new system.
Diffstat (limited to 'sleekxmpp/plugins/xep_0172/user_nick.py')
-rw-r--r--sleekxmpp/plugins/xep_0172/user_nick.py23
1 files changed, 8 insertions, 15 deletions
diff --git a/sleekxmpp/plugins/xep_0172/user_nick.py b/sleekxmpp/plugins/xep_0172/user_nick.py
index cd3c22f3..c20c3583 100644
--- a/sleekxmpp/plugins/xep_0172/user_nick.py
+++ b/sleekxmpp/plugins/xep_0172/user_nick.py
@@ -13,35 +13,28 @@ from sleekxmpp.stanza.presence import Presence
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_0172 import stanza, UserNick
log = logging.getLogger(__name__)
-class xep_0172(base_plugin):
+class XEP_0172(BasePlugin):
"""
XEP-0172: User Nickname
"""
- def plugin_init(self):
- self.xep = '0172'
- self.description = 'User Nickname'
- self.stanza = stanza
-
- def post_init(self):
- base_plugin.post_init(self)
+ name = 'xep_0172'
+ description = 'XEP-0172: User Nickname'
+ dependencies = set(['xep_0163'])
+ stanza = stanza
- pubsub_stanza = self.xmpp['xep_0060'].stanza
+ def plugin_init(self):
register_stanza_plugin(Message, UserNick)
register_stanza_plugin(Presence, UserNick)
- register_stanza_plugin(pubsub_stanza.EventItem, UserNick)
-
- self.xmpp['xep_0030'].add_feature(UserNick.namespace)
- self.xmpp['xep_0163'].add_interest(UserNick.namespace)
- self.xmpp['xep_0060'].map_node_event(UserNick.namespace, 'user_nick')
+ self.xmpp['xep_0163'].register_pep('user_nick', UserNick)
def publish_nick(self, nick=None, options=None, ifrom=None, block=True,
callback=None, timeout=None):