Move feature_starttls to new system.

This commit is contained in:
Lance Stout 2012-03-12 19:57:20 -07:00
parent ed5a2f400d
commit 24ec448b7f
2 changed files with 17 additions and 8 deletions

View file

@ -6,5 +6,14 @@
See the file LICENSE for copying permission. See the file LICENSE for copying permission.
""" """
from sleekxmpp.features.feature_starttls.starttls import feature_starttls from sleekxmpp.plugins.base import register_plugin
from sleekxmpp.features.feature_starttls.starttls import FeatureSTARTTLS
from sleekxmpp.features.feature_starttls.stanza import * from sleekxmpp.features.feature_starttls.stanza import *
register_plugin(FeatureSTARTTLS)
# Retain some backwards compatibility
feature_starttls = FeatureSTARTTLS

View file

@ -10,23 +10,23 @@ import logging
from sleekxmpp.stanza import StreamFeatures from sleekxmpp.stanza import StreamFeatures
from sleekxmpp.xmlstream import RestartStream, register_stanza_plugin from sleekxmpp.xmlstream import RestartStream, register_stanza_plugin
from sleekxmpp.plugins import BasePlugin
from sleekxmpp.xmlstream.matcher import MatchXPath from sleekxmpp.xmlstream.matcher import MatchXPath
from sleekxmpp.xmlstream.handler import Callback from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.plugins.base import base_plugin
from sleekxmpp.features.feature_starttls import stanza from sleekxmpp.features.feature_starttls import stanza
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class feature_starttls(base_plugin): class FeatureSTARTTLS(BasePlugin):
name = 'feature_starttls'
description = 'RFC 6120: Stream Feature: STARTTLS'
dependencies = set()
stanza = stanza
def plugin_init(self): def plugin_init(self):
self.name = "STARTTLS"
self.rfc = '6120'
self.description = "STARTTLS Stream Feature"
self.stanza = stanza
self.xmpp.register_handler( self.xmpp.register_handler(
Callback('STARTTLS Proceed', Callback('STARTTLS Proceed',
MatchXPath(stanza.Proceed.tag_name()), MatchXPath(stanza.Proceed.tag_name()),