changeset f8c67c7b3156 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=f8c67c7b3156 description: Also cancel the jingle session when initiator for IBB transfer cancellation
diffstat:
src/common/file_props.py | 1 + src/common/protocol/bytestream.py | 8 ++++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
diffs (29 lines):
diff -r e181dae4f5a5 -r f8c67c7b3156 src/common/file_props.py --- a/src/common/file_props.py Sat Jan 19 21:24:30 2013 -0400 +++ b/src/common/file_props.py Sat Jan 19 21:40:19 2013 -0400 @@ -135,6 +135,7 @@ self.hash_ = None self.fd = None self.startexmpp = None + # Type of the session, if it is 'jingle' or 'si' self.session_type = None self.request_id = None self.proxyhosts = None diff -r e181dae4f5a5 -r f8c67c7b3156 src/common/protocol/bytestream.py --- a/src/common/protocol/bytestream.py Sat Jan 19 21:24:30 2013 -0400 +++ b/src/common/protocol/bytestream.py Sat Jan 19 21:40:19 2013 -0400 @@ -811,6 +811,14 @@ file_props.direction[1:], 'set', payload=[nbxmpp.Node(nbxmpp.NS_IBB + ' close', {'sid':file_props.sid})])) + if file_props.session_type == 'jingle': + peerjid = \ + file_props.receiver if file_props.type_ == 's' else file_props.sender + session = self.get_jingle_session(peerjid, file_props.sid, 'file') + # According to the xep, the initiator also cancels the jingle session + # if there are no more files to send using IBB + if session.weinitiate: + session.cancel_session()
def OpenStream(self, sid, to, fp, blocksize=4096):