diff options
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r-- | sleekxmpp/plugins/xep_0108/__init__.py | 7 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0108/user_activity.py | 26 |
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): |