about summary refs log tree commit diff stats
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-06-16 22:55:07 +0200
committerPaul Fariello <paul@fariello.eu>2019-06-20 14:30:37 +0200
commit3bb3cc625d1714fd5e81ef0adba61a5172c3212d (patch)
tree1dea4bfe4da4f67d2ba03a70b9bab3ce455763d6 /src/ui/window.c
parenta650ecc67d700ae14a1bd05ca6196533829ba5ce (diff)
downloadprofani-tty-3bb3cc625d1714fd5e81ef0adba61a5172c3212d.tar.gz
Use flags in xmmp/message.c for encryption and trust
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c14
1 files changed, 12 insertions, 2 deletions
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));