changeset 0c8aedd47e68 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=0c8aedd47e68
description: send content-remove when a filetranfer is finished but other are still running
diffstat:
src/gui_interface.py | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (33 lines):
diff -r 2c64c483cc02 -r 0c8aedd47e68 src/gui_interface.py
--- a/src/gui_interface.py Thu Aug 26 16:56:08 2010 +0200
+++ b/src/gui_interface.py Thu Aug 26 16:56:46 2010 +0200
@@ -1417,7 +1417,15 @@
if file_props['session-type'] == 'jingle' and file_props['type'] == 'r':
session = gajim.connections[account].get_jingle_session(jid,
sid=file_props['session-sid'])
- session.end_session()
+ # get content:
+ content = None
+ for c in session.contents.values():
+ if c.file_props['sid'] == file_props['sid']:
+ content = c
+ break
+ if not content:
+ return
+ session.remove_content('initiator', c.name)
if helpers.allow_popup_window(account):
if file_props['error'] == 0:
@@ -1484,12 +1492,6 @@
txt = _('File transfer of %(filename)s to %(name)s '
'stopped.') % {'filename': filename, 'name': name}
img_name = 'gajim-ft_stopped'
- # if we are the sender of the file and the file transfer was initiated with jingle
- # send session-terminate stanza
- if 'session-type' in file_props and file_props['session-type'] == 'jingle':
- sender = gajim.get_jid_without_resource(file_props['sender'])
- jingle_session = gajim.connections[account].get_jingle_session(sender, file_props['sid'])
- jingle_session.end_session()
path = gtkgui_helpers.get_icon_path(img_name, 48)
else:
txt = ''