summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0108
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 19:18:03 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:20 -0700
commita2b47e57493fbd399df371c3feac7aa54f928f98 (patch)
tree5ced204a5363550e59d4fa6f430251b009bd2bbd /sleekxmpp/plugins/xep_0108
parent14d4062f4afe961e3dccf8eec7ef84ec22512fca (diff)
downloadslixmpp-a2b47e57493fbd399df371c3feac7aa54f928f98.tar.gz
slixmpp-a2b47e57493fbd399df371c3feac7aa54f928f98.tar.bz2
slixmpp-a2b47e57493fbd399df371c3feac7aa54f928f98.tar.xz
slixmpp-a2b47e57493fbd399df371c3feac7aa54f928f98.zip
Move XEP-0108 to new system.
Diffstat (limited to 'sleekxmpp/plugins/xep_0108')
-rw-r--r--sleekxmpp/plugins/xep_0108/__init__.py7
-rw-r--r--sleekxmpp/plugins/xep_0108/user_activity.py26
2 files changed, 14 insertions, 19 deletions
diff --git a/sleekxmpp/plugins/xep_0108/__init__.py b/sleekxmpp/plugins/xep_0108/__init__.py
index ab824715..34d45113 100644
--- a/sleekxmpp/plugins/xep_0108/__init__.py
+++ b/sleekxmpp/plugins/xep_0108/__init__.py
@@ -6,6 +6,11 @@
See the file LICENSE for copying permission.
"""
+from sleekxmpp.plugins.base import register_plugin
+
from sleekxmpp.plugins.xep_0108 import stanza
from sleekxmpp.plugins.xep_0108.stanza import UserActivity
-from sleekxmpp.plugins.xep_0108.user_activity import xep_0108
+from sleekxmpp.plugins.xep_0108.user_activity import XEP_0108
+
+
+register_plugin(XEP_0108)
diff --git a/sleekxmpp/plugins/xep_0108/user_activity.py b/sleekxmpp/plugins/xep_0108/user_activity.py
index 3e400af2..43270486 100644
--- a/sleekxmpp/plugins/xep_0108/user_activity.py
+++ b/sleekxmpp/plugins/xep_0108/user_activity.py
@@ -8,36 +8,26 @@
import logging
-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_0108 import stanza, UserActivity
log = logging.getLogger(__name__)
-class xep_0108(base_plugin):
+class XEP_0108(BasePlugin):
"""
XEP-0108: User Activity
"""
- def plugin_init(self):
- self.xep = '0108'
- self.description = 'User Activity'
- self.stanza = stanza
-
- def post_init(self):
- base_plugin.post_init(self)
+ name = 'xep_0108'
+ description = 'XEP-0108: User Activity'
+ dependencies = set(['xep_0163'])
+ stanza = stanza
- pubsub_stanza = self.xmpp['xep_0060'].stanza
- register_stanza_plugin(pubsub_stanza.EventItem, UserActivity)
-
- self.xmpp['xep_0030'].add_feature(UserActivity.namespace)
- self.xmpp['xep_0163'].add_interest(UserActivity.namespace)
- self.xmpp['xep_0060'].map_node_event(UserActivity.namespace, 'user_activity')
+ def plugin_init(self):
+ self.xmpp['xep_0163'].register_pep('user_activity', UserActivity)
def publish_activity(self, general, specific=None, text=None, options=None,
ifrom=None, block=True, callback=None, timeout=None):