From b7863b031659377b7aceae43f8db76615b9d5075 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 15 May 2008 04:03:19 +0000 Subject: [PATCH] fix tb when closing chat control after e2e ended --- src/gajim.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index 98dfd6829..34a7c66aa 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -2018,16 +2018,26 @@ class Interface: form.getField('terminate').getValue() in ('1', 'true'): was_encrypted = session.enable_encryption ctrl = session.control + jid = str(jid) session.acknowledge_termination() - gajim.connections[account].delete_session(str(jid), session.thread_id) + gajim.connections[account].delete_session(jid, session.thread_id) if ctrl: - new_sess = gajim.connections[account].make_new_session(str(jid)) + # replace the old session in this control with a new one + new_sess = gajim.connections[account].make_new_session(jid) + win = ctrl.parent_win + ctrl.set_session(new_sess) - gajim.connections[account].delete_session(str(jid), + gajim.connections[account].delete_session(jid, session.thread_id) + if not jid in win._controls[account]: + jid = gajim.get_jid_without_resource(jid) + + del win._controls[account][jid][session.thread_id] + win._controls[account][jid][new_sess.thread_id] = ctrl + if was_encrypted: ctrl.print_esession_details()