Move feature_session to new system.

This commit is contained in:
Lance Stout 2012-03-12 19:52:20 -07:00
parent 9596616b42
commit ed5a2f400d
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_session.session import feature_session from sleekxmpp.plugins.base import register_plugin
from sleekxmpp.features.feature_session.session import FeatureSession
from sleekxmpp.features.feature_session.stanza import Session from sleekxmpp.features.feature_session.stanza import Session
register_plugin(FeatureSession)
# Retain some backwards compatibility
feature_session = FeatureSession

View file

@ -10,7 +10,7 @@ import logging
from sleekxmpp.stanza import Iq, StreamFeatures from sleekxmpp.stanza import Iq, StreamFeatures
from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.base import base_plugin from sleekxmpp.plugins import BasePlugin
from sleekxmpp.features.feature_session import stanza from sleekxmpp.features.feature_session import stanza
@ -18,14 +18,14 @@ from sleekxmpp.features.feature_session import stanza
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class feature_session(base_plugin): class FeatureSession(BasePlugin):
name = 'feature_session'
description = 'RFC 3920: Stream Feature: Start Session'
dependencies = set()
stanza = stanza
def plugin_init(self): def plugin_init(self):
self.name = 'Start Session'
self.rfc = '3920'
self.description = 'Start Session Stream Feature'
self.stanza = stanza
self.xmpp.register_feature('session', self.xmpp.register_feature('session',
self._handle_start_session, self._handle_start_session,
restart=False, restart=False,