From ac0e0448b2626a6e0d7269119d2383ee69c7ea56 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 26 Aug 2010 16:56:46 +0200 Subject: [PATCH] send content-remove when a filetranfer is finished but other are still running --- src/gui_interface.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui_interface.py b/src/gui_interface.py index da19d1938..a30ac6e66 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -1417,7 +1417,15 @@ class Interface: 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 @@ class Interface: 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 = ''