Commit 0b5846d1 authored by Yann Leboulanger's avatar Yann Leboulanger

improve bosh connection to ejabberd 3.0

parent 4c624a52
......@@ -23,7 +23,7 @@ from hashlib import sha1
from transports_nb import NonBlockingTransport, NonBlockingHTTPBOSH,\
CONNECTED, CONNECTING, DISCONNECTED, DISCONNECTING,\
urisplit, DISCONNECT_TIMEOUT_SECONDS
from protocol import BOSHBody
from protocol import BOSHBody, Protocol, NS_CLIENT
from simplexml import Node
import logging
......@@ -197,6 +197,11 @@ class NonBlockingBOSH(NonBlockingTransport):
self.get_state()==DISCONNECTED:
return
# Add xmlns to stanza to help ejabberd server
if payload and isinstance(payload, Protocol):
if not payload.getNamespace():
payload.setNamespace(NS_CLIENT)
# now the payload is put to buffer and will be sent at some point
self.append_stanza(payload)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment