1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Added [OTR] and (trusted/untrusted) to titlebar for OTR sessions

This commit is contained in:
James Booth 2014-01-11 18:24:44 +00:00
parent bf494b1b07
commit b5469e2e06
5 changed files with 17 additions and 0 deletions

View File

@ -2330,6 +2330,8 @@ cmd_otr(gchar **args, struct cmd_help_t help)
char *recipient = ui_current_recipient();
message_send("?OTR?", recipient);
ui_current_set_otr(TRUE);
// refresh to show OTR in titlebar
ui_switch_win(ui_current_win_index());
}
}
return TRUE;

View File

@ -228,6 +228,10 @@ otr_on_connect(ProfAccount *account)
}
}
if (data_loaded) {
cons_show("Loaded OTR private key for %s", jid);
}
g_string_free(basedir, TRUE);
g_string_free(keysfilename, TRUE);
g_string_free(fpsfilename, TRUE);

View File

@ -516,6 +516,15 @@ _get_recipient_string(ProfWin *window)
g_string_append(result, window->from);
}
if (window->is_otr) {
g_string_append(result, " [OTR]");
if (window->is_trusted) {
g_string_append(result, " (trusted)");
} else {
g_string_append(result, " (untrusted)");
}
}
return result;
}

View File

@ -55,6 +55,7 @@ win_create(const char * const title, int cols, win_type_t type)
new_win->history_shown = 0;
new_win->type = type;
new_win->is_otr = FALSE;
new_win->is_trusted = FALSE;
scrollok(new_win->win, TRUE);
return new_win;

View File

@ -49,6 +49,7 @@ typedef struct prof_win_t {
WINDOW *win;
win_type_t type;
gboolean is_otr;
gboolean is_trusted;
int y_pos;
int paged;
int unread;