fix tb when closing chat control after e2e ended

This commit is contained in:
Brendan Taylor 2008-05-15 04:03:19 +00:00
parent d41f245370
commit b7863b0316
1 changed files with 13 additions and 3 deletions

View File

@ -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()