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

accept session as soon as one content is accepted

parent 99981e57
No related branches found
No related tags found
No related merge requests found
......@@ -223,6 +223,8 @@ class JingleFileTransfer(JingleContent):
# send error message, notify the user
elif not self.weinitiate and self.state == STATE_NOT_STARTED:
# session-accept iq-result
if not self.sent:
return
self.state = STATE_ACCEPTED
if not gajim.socks5queue.get_file_props(
self.session.connection.name, self.file_props['sid']):
......
......@@ -247,6 +247,9 @@ class JingleSession(object):
"""
Return True when all codecs and candidates are ready (for all contents)
"""
for c in self.contents.itervalues():
if c.is_ready():
return True
return (all((content.is_ready() for content in self.contents.itervalues()))
and self.accepted)
......@@ -623,7 +626,8 @@ class JingleSession(object):
# TODO: integrate with __appendContent?
# TODO: parameters 'name', 'content'?
for content in self.contents.values():
self.__append_content(jingle, content)
if content.is_ready():
self.__append_content(jingle, content)
def __session_initiate(self):
assert self.state == JingleStates.ended
......
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