core: replaced calls to client.xmlstream.send by client.send which is the right method to use. client.xmlstream should not be used directly

This commit is contained in:
Goffi 2017-02-04 17:59:13 +01:00
commit 6467bdb3c3
14 changed files with 54 additions and 58 deletions

View file

@ -189,7 +189,7 @@ class XEP_0047(object):
client.xmlstream.addOnetimeObserver(event_close, self._onIBBClose, profile=profile)
# finally, we send the accept stanza
iq_result_elt = xmlstream.toResponse(iq_elt, 'result')
client.xmlstream.send(iq_result_elt)
client.send(iq_result_elt)
def _onIBBClose(self, iq_elt, profile):
""""Called when an IBB <close> element is received
@ -205,7 +205,7 @@ class XEP_0047(object):
sid = close_elt['sid']
iq_result_elt = xmlstream.toResponse(iq_elt, 'result')
client.xmlstream.send(iq_result_elt)
client.send(iq_result_elt)
self._killSession(sid, client)
def _onIBBData(self, element, profile):
@ -261,7 +261,7 @@ class XEP_0047(object):
# we can now ack success
if element.name == 'iq':
iq_result_elt = xmlstream.toResponse(element, 'result')
client.xmlstream.send(iq_result_elt)
client.send(iq_result_elt)
def _sendError(self, error_condition, sid, iq_elt, client):
"""Send error stanza
@ -275,7 +275,7 @@ class XEP_0047(object):
log.warning(u"Error while managing in-band bytestream session, cancelling: {}".format(error_condition))
if sid is not None:
self._killSession(sid, client, error_condition)
client.xmlstream.send(iq_elt)
client.send(iq_elt)
def startStream(self, file_obj, to_jid, sid, block_size=None, profile=C.PROF_KEY_NONE):
"""Launch the stream workflow