Skip to content
Snippets Groups Projects
Commit 53c31a53 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

session packet are not mendatory during login. Send it only when requested by server. Fixes #5088

parent c4a720aa
No related branches found
No related tags found
No related merge requests found
......@@ -504,9 +504,13 @@ class NonBlockingBind(PlugIn):
jid = JID(resp.getTag('bind').getTagData('jid'))
self._owner.User = jid.getNode()
self._owner.Resource = jid.getResource()
self._owner.SendAndWaitForResponse(Protocol('iq', typ='set',
payload=[Node('session', attrs={'xmlns':NS_SESSION})]),
func=self._on_session)
if self.session == -1: #Server don't want us to initialize a session
log.info('No session required.')
self.on_bound('ok')
else:
self._owner.SendAndWaitForResponse(Protocol('iq', typ='set',
payload=[Node('session', attrs={'xmlns':NS_SESSION})]),
func=self._on_session)
return
if resp:
log.error('Binding failed: %s.' % resp.getTag('error'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment