Changeset 14:312a60e100c4


Ignore:
Timestamp:
Feb 29, 2008, 4:27:36 PM (14 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@42
Message:

Make sure the deferred is fired by the stream manager, so that the latter
can do its initializations, first.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/client.py

    r8 r14  
    2121    from wokkel.compat import XmlStreamFactoryMixin
    2222
    23 
    24 from wokkel.subprotocols import StreamManager
     23from wokkel.subprotocols import StreamManager, XMPPHandler
    2524
    2625class CheckAuthInitializer(object):
     
    136135        XmlStreamFactoryMixin.__init__(self, self.authenticator)
    137136
    138         self.deferred = defer.Deferred()
     137        deferred = defer.Deferred()
     138        self.deferred = deferred
    139139
    140         self.addBootstrap(xmlstream.STREAM_AUTHD_EVENT, self.deferred.callback)
    141         self.addBootstrap(xmlstream.INIT_FAILED_EVENT, self.deferred.errback)
     140        self.addBootstrap(xmlstream.INIT_FAILED_EVENT, deferred.errback)
     141
     142        class ConnectionInitializedHandler(XMPPHandler):
     143            def connectionInitialized(self):
     144                deferred.callback(None)
    142145
    143146        self.streamManager = StreamManager(self)
     147        self.addHandler(ConnectionInitializedHandler())
    144148
    145149    def clientConnectionFailed(self, connector, reason):
Note: See TracChangeset for help on using the changeset viewer.