session packet are not mendatory during login. Send it only when requested by server. Fixes #5088
This commit is contained in:
parent
c4a720aa89
commit
53c31a53b6
|
@ -504,9 +504,13 @@ class NonBlockingBind(PlugIn):
|
||||||
jid = JID(resp.getTag('bind').getTagData('jid'))
|
jid = JID(resp.getTag('bind').getTagData('jid'))
|
||||||
self._owner.User = jid.getNode()
|
self._owner.User = jid.getNode()
|
||||||
self._owner.Resource = jid.getResource()
|
self._owner.Resource = jid.getResource()
|
||||||
self._owner.SendAndWaitForResponse(Protocol('iq', typ='set',
|
if self.session == -1: #Server don't want us to initialize a session
|
||||||
payload=[Node('session', attrs={'xmlns':NS_SESSION})]),
|
log.info('No session required.')
|
||||||
func=self._on_session)
|
self.on_bound('ok')
|
||||||
|
else:
|
||||||
|
self._owner.SendAndWaitForResponse(Protocol('iq', typ='set',
|
||||||
|
payload=[Node('session', attrs={'xmlns':NS_SESSION})]),
|
||||||
|
func=self._on_session)
|
||||||
return
|
return
|
||||||
if resp:
|
if resp:
|
||||||
log.error('Binding failed: %s.' % resp.getTag('error'))
|
log.error('Binding failed: %s.' % resp.getTag('error'))
|
||||||
|
|
Loading…
Reference in New Issue