diff options
author | James Booth <boothj5@gmail.com> | 2016-01-08 00:22:17 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-01-08 00:22:17 +0000 |
commit | 51f033ae42c9fd6f1e715d170509e3f277586e10 (patch) | |
tree | 416db6fa848cb8aed62116146919293c42b4f4c9 /src | |
parent | a90e109f7eb188e31bb6c26ee1aed641ff694f93 (diff) | |
download | profani-tty-51f033ae42c9fd6f1e715d170509e3f277586e10.tar.gz |
End OTR sessions on lost server connection
Diffstat (limited to 'src')
-rw-r--r-- | src/event/server_events.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index ae5608e2..147ea6ce 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -152,6 +152,23 @@ sv_ev_lost_connection(void) { cons_show_error("Lost connection."); +#ifdef HAVE_LIBOTR + GSList *recipients = wins_get_chat_recipients(); + GSList *curr = recipients; + while (curr) { + char *barejid = curr->data; + ProfChatWin *chatwin = wins_get_chat(barejid); + if (chatwin && otr_is_secure(barejid)) { + chatwin_otr_unsecured(chatwin); + otr_end_session(barejid); + } + curr = g_slist_next(curr); + } + if (recipients) { + g_slist_free(recipients); + } +#endif + muc_invites_clear(); chat_sessions_clear(); ui_disconnected(); |