Move XEP-0118 to the new system.
This commit is contained in:
parent
a2b47e5749
commit
32d6f85649
@ -6,6 +6,11 @@
|
|||||||
See the file LICENSE for copying permission.
|
See the file LICENSE for copying permission.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from sleekxmpp.plugins.base import register_plugin
|
||||||
|
|
||||||
from sleekxmpp.plugins.xep_0118 import stanza
|
from sleekxmpp.plugins.xep_0118 import stanza
|
||||||
from sleekxmpp.plugins.xep_0118.stanza import UserTune
|
from sleekxmpp.plugins.xep_0118.stanza import UserTune
|
||||||
from sleekxmpp.plugins.xep_0118.user_tune import xep_0118
|
from sleekxmpp.plugins.xep_0118.user_tune import XEP_0118
|
||||||
|
|
||||||
|
|
||||||
|
register_plugin(XEP_0118)
|
||||||
|
@ -8,34 +8,26 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from sleekxmpp.xmlstream import register_stanza_plugin
|
from sleekxmpp.plugins.base import BasePlugin
|
||||||
from sleekxmpp.xmlstream.handler import Callback
|
|
||||||
from sleekxmpp.xmlstream.matcher import MatchXPath
|
|
||||||
from sleekxmpp.plugins.base import base_plugin
|
|
||||||
from sleekxmpp.plugins.xep_0118 import stanza, UserTune
|
from sleekxmpp.plugins.xep_0118 import stanza, UserTune
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class xep_0118(base_plugin):
|
class XEP_0118(BasePlugin):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
XEP-0118: User Tune
|
XEP-0118: User Tune
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def plugin_init(self):
|
name = 'xep_0118'
|
||||||
self.xep = '0118'
|
description = 'XEP-0118: User Tune'
|
||||||
self.description = 'User Tune'
|
dependencies = set(['xep_0163'])
|
||||||
self.stanza = stanza
|
stanza = stanza
|
||||||
|
|
||||||
def post_init(self):
|
def plugin_init(self):
|
||||||
base_plugin.post_init(self)
|
self.xmpp['xep_0163'].register_pep('user_tune', UserTune)
|
||||||
pubsub_stanza = self.xmpp['xep_0060'].stanza
|
|
||||||
register_stanza_plugin(pubsub_stanza.EventItem, UserTune)
|
|
||||||
self.xmpp['xep_0030'].add_feature(UserTune.namespace)
|
|
||||||
self.xmpp['xep_0163'].add_interest(UserTune.namespace)
|
|
||||||
self.xmpp['xep_0060'].map_node_event(UserTune.namespace, 'user_tune')
|
|
||||||
|
|
||||||
def publish_tune(self, artist=None, length=None, rating=None, source=None,
|
def publish_tune(self, artist=None, length=None, rating=None, source=None,
|
||||||
title=None, track=None, uri=None, options=None,
|
title=None, track=None, uri=None, options=None,
|
||||||
|
Loading…
Reference in New Issue
Block a user