plugin XEP-0065: fixed initialisation sequence
This commit is contained in:
parent
7aa7895208
commit
bbb546402f
1 changed files with 18 additions and 16 deletions
|
|
@ -787,22 +787,24 @@ class XEP_0065_handler(XMPPHandler):
|
|||
"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=''):
|
||||
|
|
|
|||
Loading…
Reference in a new issue