Move XEP-0115 to the new system.
This commit is contained in:
parent
8b2023225c
commit
57d761b8a2
2 changed files with 18 additions and 10 deletions
|
@ -6,6 +6,15 @@
|
||||||
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_0115.stanza import Capabilities
|
from sleekxmpp.plugins.xep_0115.stanza import Capabilities
|
||||||
from sleekxmpp.plugins.xep_0115.static import StaticCaps
|
from sleekxmpp.plugins.xep_0115.static import StaticCaps
|
||||||
from sleekxmpp.plugins.xep_0115.caps import xep_0115
|
from sleekxmpp.plugins.xep_0115.caps import XEP_0115
|
||||||
|
|
||||||
|
|
||||||
|
register_plugin(XEP_0115)
|
||||||
|
|
||||||
|
|
||||||
|
# Retain some backwards compatibility
|
||||||
|
xep_0115 = XEP_0115
|
||||||
|
|
|
@ -15,25 +15,26 @@ from sleekxmpp.stanza import StreamFeatures, Presence, Iq
|
||||||
from sleekxmpp.xmlstream import register_stanza_plugin, JID
|
from sleekxmpp.xmlstream import register_stanza_plugin, JID
|
||||||
from sleekxmpp.xmlstream.handler import Callback
|
from sleekxmpp.xmlstream.handler import Callback
|
||||||
from sleekxmpp.xmlstream.matcher import StanzaPath
|
from sleekxmpp.xmlstream.matcher import StanzaPath
|
||||||
from sleekxmpp.exceptions import XMPPError
|
from sleekxmpp.exceptions import XMPPError, IqError, IqTimeout
|
||||||
from sleekxmpp.plugins.base import base_plugin
|
from sleekxmpp.plugins import BasePlugin
|
||||||
from sleekxmpp.plugins.xep_0115 import stanza, StaticCaps
|
from sleekxmpp.plugins.xep_0115 import stanza, StaticCaps
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class xep_0115(base_plugin):
|
class XEP_0115(BasePlugin):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
XEP-0115: Entity Capabalities
|
XEP-0115: Entity Capabalities
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def plugin_init(self):
|
name = 'xep_0115'
|
||||||
self.xep = '0115'
|
description = 'XEP-0115: Entity Capabilities'
|
||||||
self.description = 'Entity Capabilities'
|
dependencies = set(['xep_0030', 'xep_0128', 'xep_0004'])
|
||||||
self.stanza = stanza
|
stanza = stanza
|
||||||
|
|
||||||
|
def plugin_init(self):
|
||||||
self.hashes = {'sha-1': hashlib.sha1,
|
self.hashes = {'sha-1': hashlib.sha1,
|
||||||
'md5': hashlib.md5}
|
'md5': hashlib.md5}
|
||||||
|
|
||||||
|
@ -71,8 +72,6 @@ class xep_0115(base_plugin):
|
||||||
restart=False,
|
restart=False,
|
||||||
order=10010)
|
order=10010)
|
||||||
|
|
||||||
def post_init(self):
|
|
||||||
base_plugin.post_init(self)
|
|
||||||
self.xmpp['xep_0030'].add_feature(stanza.Capabilities.namespace)
|
self.xmpp['xep_0030'].add_feature(stanza.Capabilities.namespace)
|
||||||
|
|
||||||
disco = self.xmpp['xep_0030']
|
disco = self.xmpp['xep_0030']
|
||||||
|
|
Loading…
Reference in a new issue