From 7a0a578a8a56cb6689ac9fce680aa44f5af8926d Mon Sep 17 00:00:00 2001 From: Aurelien Aptel Date: Tue, 3 Dec 2019 20:59:18 +0100 Subject: XEP-0392: theme, ui: conditionally colorize user nicks * add theme_hash_attrs() * when printing a user message check PREF_COLOR_NICK to decide whether to colorize it or not ideally we should hash the jid instead of the nick but this is already a first step. --- src/ui/window.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ui/window.c') diff --git a/src/ui/window.c b/src/ui/window.c index 12bf40f5..47230150 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1453,6 +1453,10 @@ _win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *tim colour = theme_attrs(THEME_THEM); } + if (prefs_get_boolean(PREF_COLOR_NICK)) { + colour = theme_hash_attrs(from); + } + if (flags & NO_COLOUR_FROM) { colour = 0; } -- cgit 1.4.1-2-gfad0