From 71aea78e90da371ca3a290f3bcd1925a7bdbcba1 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 19 Apr 2014 00:03:11 +0100 Subject: Open new window when otr session started by contact fixes #331 --- src/ui/core.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/ui/core.c b/src/ui/core.c index b6acc925..6e7b992a 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -751,21 +751,26 @@ static void _ui_gone_secure(const char * const recipient, gboolean trusted) { ProfWin *window = wins_get_by_recipient(recipient); - if (window != NULL) { - window->is_otr = TRUE; - 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 (window == NULL) { + window = wins_new(recipient, WIN_CHAT); + } - 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); - } + window->is_otr = TRUE; + 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)) { + 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); } } -- cgit 1.4.1-2-gfad0 orm'>
path: root/tests/unittests/test_preferences.c
blob: 05f34ca6055aaead75ebd0723a89f93dcb52d018 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36