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

View file

@ -139,7 +139,7 @@ class XEP_0166(object):
if error.STANZA_CONDITIONS[error_condition]['type'] == 'cancel' and sid:
self._delSession(client, sid)
log.warning(u"Error while managing jingle session, cancelling: {condition}".format(error_condition))
client.xmlstream.send(iq_elt)
client.send(iq_elt)
def terminate(self, reason, session, profile):
"""Terminate the session
@ -692,7 +692,7 @@ class XEP_0166(object):
return
# at this point we can send the <iq/> result to confirm reception of the request
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
# we now request each application plugin confirmation
# and if all are accepted, we can accept the session
@ -770,7 +770,7 @@ class XEP_0166(object):
terminate_dlist = defer.DeferredList(terminate_defers)
terminate_dlist.addCallback(lambda dummy: self._delSession(client, session['id']))
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
def onSessionAccept(self, client, request, jingle_elt, session):
"""Method called once session is accepted
@ -789,7 +789,7 @@ class XEP_0166(object):
return
# at this point we can send the <iq/> result to confirm reception of the request
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
# and change the state
session['state'] = STATE_ACTIVE
@ -802,7 +802,7 @@ class XEP_0166(object):
negociate_dlist.addCallback(lambda dummy: self._callPlugins(XEP_0166.A_START, session, app_method_name=None, elements=False, profile=client.profile))
def _onSessionCb(self, result, client, request, jingle_elt, session):
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
def _onSessionEb(self, failure_, client, request, jingle_elt, session):
log.error(u"Error while handling onSessionInfo: {}".format(failure_.value))
@ -820,7 +820,7 @@ class XEP_0166(object):
"""
if not jingle_elt.children:
# this is a session ping, see XEP-0166 §6.8
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
return
try:
@ -852,7 +852,7 @@ class XEP_0166(object):
except exceptions.CancelError:
defer.returnValue(None)
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
content_name = None
to_replace = []
@ -916,7 +916,7 @@ class XEP_0166(object):
return
# at this point we can send the <iq/> result to confirm reception of the request
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
negociate_defers = []
negociate_defers = self._callPlugins(XEP_0166.A_TRANSPORT_ACCEPT, session, app_method_name=None, profile=client.profile)
@ -955,7 +955,7 @@ class XEP_0166(object):
return
# The parsing was OK, we send the <iq> result
client.xmlstream.send(xmlstream.toResponse(request, 'result'))
client.send(xmlstream.toResponse(request, 'result'))
for content_name, content_data in session['contents'].iteritems():
try: