From 3bb3cc625d1714fd5e81ef0adba61a5172c3212d Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Sun, 16 Jun 2019 22:55:07 +0200 Subject: Use flags in xmmp/message.c for encryption and trust --- src/ui/window.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/ui/window.c') diff --git a/src/ui/window.c b/src/ui/window.c index 12b6c15b..90508917 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1048,6 +1048,11 @@ win_print_incoming(ProfWin *window, GDateTime *timestamp, const char *const from, const char *const message, prof_enc_t enc_mode) { char enc_char = '-'; + int flags = NO_ME; + + if (!trusted) { + flags != NO_TRUST; + } switch (window->type) { @@ -1063,11 +1068,11 @@ win_print_incoming(ProfWin *window, GDateTime *timestamp, } else if (enc_mode == PROF_MSG_OMEMO) { enc_char = prefs_get_omemo_char(); } - _win_printf(window, enc_char, 0, timestamp, NO_ME, THEME_TEXT_THEM, from, "%s", message); + _win_printf(window, enc_char, 0, timestamp, flags, THEME_TEXT_THEM, from, "%s", message); break; } case WIN_PRIVATE: - _win_printf(window, '-', 0, timestamp, NO_ME, THEME_TEXT_THEM, from, "%s", message); + _win_printf(window, '-', 0, timestamp, flags, THEME_TEXT_THEM, from, "%s", message); break; default: assert(FALSE); @@ -1384,6 +1389,7 @@ _win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *tim // 3rd bit = 0/1 - eol/no eol // 4th bit = 0/1 - color from/no color from // 5th bit = 0/1 - color date/no date + // 6th bit = 0/1 - not trusted/trusted gboolean me_message = FALSE; int offset = 0; int colour = theme_attrs(THEME_ME); @@ -1462,6 +1468,10 @@ _win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *tim } } + if (flags & NO_TRUST) { + colour = theme_attrs(THEME_NO_TRUST); + } + if (!me_message) { if (receipt && !receipt->received) { wbkgdset(window->layout->win, theme_attrs(THEME_RECEIPT_SENT)); -- cgit 1.4.1-2-gfad0