def addHandler(self, handler): """ Add a new handler and connect it to the stream. """ XMPPHandlerCollection.addHandler(self, handler) if self.xmlstream: handler.makeConnection(self.xmlstream) handler.connectionInitialized()
def addHandler(self, handler): """ Add protocol handler. When an XML stream has already been established, the handler's C{connectionInitialized} will be called to get it up to speed. """ XMPPHandlerCollection.addHandler(self, handler) # get protocol handler up to speed when a connection has already # been established if self.xmlstream: handler.makeConnection(self.xmlstream) if self._initialized: handler.connectionInitialized()