# HG changeset patch # User Goffi # Date 1396274895 -7200 # Node ID 132de9d487ac9cedaf03eca132b9f5904c7f461e # Parent cad958239b5c18930751acbb240dc68ff61bffdb plugin XEP-0065: fixed initialisation sequence diff -r cad958239b5c -r 132de9d487ac src/plugins/plugin_xep_0065.py --- a/src/plugins/plugin_xep_0065.py Mon Mar 31 15:22:35 2014 +0200 +++ b/src/plugins/plugin_xep_0065.py Mon Mar 31 16:08:15 2014 +0200 @@ -787,22 +787,24 @@ "File Transfer", profile_key=self.parent.profile) def connectionInitialized(self): - self.xmlstream.addObserver(BS_REQUEST, self.plugin_parent.streamQuery, profile=self.parent.profile) - proxy = self.host.memory.getParamA("Proxy", "File Transfer", profile_key=self.parent.profile) - if not proxy: - def proxiesFound(entities): - try: - proxy_ent = entities.pop() - except KeyError: - info(_("No proxy found on this server")) - return - iq_elt = jabber_client.IQ(self.parent.xmlstream, 'get') - iq_elt["to"] = proxy_ent.full() - iq_elt.addElement('query', NS_BS) - iq_elt.addCallback(self._proxyDataResult) - iq_elt.send() - d = self.host.findServiceEntities("proxy", "bytestreams", profile_key=self.parent.profile) - d.addCallback(proxiesFound) + def connection_ok(dummy): + self.xmlstream.addObserver(BS_REQUEST, self.plugin_parent.streamQuery, profile=self.parent.profile) + proxy = self.host.memory.getParamA("Proxy", "File Transfer", profile_key=self.parent.profile) + if not proxy: + def proxiesFound(entities): + try: + proxy_ent = entities.pop() + except KeyError: + info(_("No proxy found on this server")) + return + iq_elt = jabber_client.IQ(self.parent.xmlstream, 'get') + iq_elt["to"] = proxy_ent.full() + iq_elt.addElement('query', NS_BS) + iq_elt.addCallback(self._proxyDataResult) + iq_elt.send() + d = self.host.findServiceEntities("proxy", "bytestreams", profile_key=self.parent.profile) + d.addCallback(proxiesFound) + self.parent.getConnectionDeferred().addCallback(connection_ok) def getDiscoInfo(self, requestor, target, nodeIdentifier=''):