1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Open new window when otr session started by contact

fixes #331
This commit is contained in:
James Booth 2014-04-19 00:03:11 +01:00
parent 8f2c0a66bf
commit 71aea78e90

View File

@ -751,21 +751,26 @@ static void
_ui_gone_secure(const char * const recipient, gboolean trusted) _ui_gone_secure(const char * const recipient, gboolean trusted)
{ {
ProfWin *window = wins_get_by_recipient(recipient); ProfWin *window = wins_get_by_recipient(recipient);
if (window != NULL) { if (window == NULL) {
window->is_otr = TRUE; window = wins_new(recipient, WIN_CHAT);
window->is_trusted = trusted; }
if (trusted) {
win_vprint_line(window, '!', COLOUR_OTR_STARTED_TRUSTED, "OTR session started (trusted).");
} else {
win_vprint_line(window, '!', COLOUR_OTR_STARTED_UNTRUSTED, "OTR session started (untrusted).");
}
if (wins_is_current(window)) { window->is_otr = TRUE;
GString *recipient_str = _get_recipient_string(window); window->is_trusted = trusted;
title_bar_set_recipient(recipient_str->str); if (trusted) {
g_string_free(recipient_str, TRUE); win_vprint_line(window, '!', COLOUR_OTR_STARTED_TRUSTED, "OTR session started (trusted).");
win_update_virtual(window); } else {
} win_vprint_line(window, '!', COLOUR_OTR_STARTED_UNTRUSTED, "OTR session started (untrusted).");
}
if (wins_is_current(window)) {
GString *recipient_str = _get_recipient_string(window);
title_bar_set_recipient(recipient_str->str);
g_string_free(recipient_str, TRUE);
win_update_virtual(window);
} else {
int num = wins_get_num(window);
status_bar_new(num);
} }
} }