only send hash if contact supports it
This commit is contained in:
parent
5bec8c7a09
commit
67c28501af
|
@ -80,12 +80,10 @@ class ConnectionJingle(object):
|
||||||
# get data
|
# get data
|
||||||
jid = helpers.get_full_jid_from_iq(stanza)
|
jid = helpers.get_full_jid_from_iq(stanza)
|
||||||
id_ = stanza.getID()
|
id_ = stanza.getID()
|
||||||
|
|
||||||
if (jid, id_) in self.__iq_responses.keys():
|
if (jid, id_) in self.__iq_responses.keys():
|
||||||
self.__iq_responses[(jid, id_)].on_stanza(stanza)
|
self.__iq_responses[(jid, id_)].on_stanza(stanza)
|
||||||
del self.__iq_responses[(jid, id_)]
|
del self.__iq_responses[(jid, id_)]
|
||||||
raise xmpp.NodeProcessed
|
raise xmpp.NodeProcessed
|
||||||
|
|
||||||
jingle = stanza.getTag('jingle')
|
jingle = stanza.getTag('jingle')
|
||||||
# a jingle element is not necessary in iq-result stanza
|
# a jingle element is not necessary in iq-result stanza
|
||||||
# don't check for that
|
# don't check for that
|
||||||
|
@ -97,14 +95,12 @@ class ConnectionJingle(object):
|
||||||
if id_ in sesn.iq_ids:
|
if id_ in sesn.iq_ids:
|
||||||
sesn.on_stanza(stanza)
|
sesn.on_stanza(stanza)
|
||||||
return
|
return
|
||||||
|
|
||||||
# do we need to create a new jingle object
|
# do we need to create a new jingle object
|
||||||
if sid not in self._sessions:
|
if sid not in self._sessions:
|
||||||
#TODO: tie-breaking and other things...
|
#TODO: tie-breaking and other things...
|
||||||
newjingle = JingleSession(con=self, weinitiate=False, jid=jid,
|
newjingle = JingleSession(con=self, weinitiate=False, jid=jid,
|
||||||
iq_id=id_, sid=sid)
|
iq_id=id_, sid=sid)
|
||||||
self._sessions[sid] = newjingle
|
self._sessions[sid] = newjingle
|
||||||
|
|
||||||
# we already have such session in dispatcher...
|
# we already have such session in dispatcher...
|
||||||
self._sessions[sid].collect_iq_id(id_)
|
self._sessions[sid].collect_iq_id(id_)
|
||||||
self._sessions[sid].on_stanza(stanza)
|
self._sessions[sid].on_stanza(stanza)
|
||||||
|
@ -112,7 +108,6 @@ class ConnectionJingle(object):
|
||||||
if sid in self._sessions and \
|
if sid in self._sessions and \
|
||||||
self._sessions[sid].state == JingleStates.ended:
|
self._sessions[sid].state == JingleStates.ended:
|
||||||
self.delete_jingle_session(sid)
|
self.delete_jingle_session(sid)
|
||||||
|
|
||||||
raise xmpp.NodeProcessed
|
raise xmpp.NodeProcessed
|
||||||
|
|
||||||
def start_audio(self, jid):
|
def start_audio(self, jid):
|
||||||
|
|
|
@ -166,7 +166,7 @@ class JingleFileTransfer(JingleContent):
|
||||||
self.file_props.streamhosts = self.transport.remote_candidates
|
self.file_props.streamhosts = self.transport.remote_candidates
|
||||||
# Calculate file hash in a new thread
|
# Calculate file hash in a new thread
|
||||||
# if we haven't sent the hash already.
|
# if we haven't sent the hash already.
|
||||||
if self.file_props.hash_ is None:
|
if self.file_props.hash_ is None and self.file_props.algo:
|
||||||
self.hashThread = threading.Thread(target=self.__send_hash)
|
self.hashThread = threading.Thread(target=self.__send_hash)
|
||||||
self.hashThread.start()
|
self.hashThread.start()
|
||||||
for host in self.file_props.streamhosts:
|
for host in self.file_props.streamhosts:
|
||||||
|
|
Loading…
Reference in New Issue