Add setting to not colorize own nick according to xep-0392
Some users might want there nick to always stay white (etc) for easier recognition. Now we can do `/color own off` to not generate the color based on xep-0392. The `me=` color (etc) from the theme will then be used. Once we run this command `theme_load()` is called again. And the theme looks totally wrong. We encountered this at other times already and I think it's nothing wrong with this new code here now but that there seems to be a missing closing attr for the color when drawing. Should be investigated seperately. Fix https://github.com/profanity-im/profanity/issues/1288
This commit is contained in:
@@ -2010,6 +2010,12 @@ cons_color_setting(void)
|
||||
|
||||
prefs_free_string(color_pref);
|
||||
|
||||
if (prefs_get_boolean(PREF_COLOR_NICK_OWN)) {
|
||||
cons_show("Consistent color generation for own nick (/color own) : ON");
|
||||
} else {
|
||||
cons_show("Consistent color generation for own nick (/color own) : OFF");
|
||||
}
|
||||
|
||||
if (prefs_get_boolean(PREF_ROSTER_COLOR_NICK)) {
|
||||
cons_show("Consistent color generation in roster (/roster color) : ON");
|
||||
} else {
|
||||
|
||||
@@ -1522,7 +1522,9 @@ _win_print_internal(ProfWin *window, const char *show_char, int pad_indent, GDat
|
||||
|
||||
char *color_pref = prefs_get_string(PREF_COLOR_NICK);
|
||||
if (color_pref != NULL && (strcmp(color_pref, "false") != 0)) {
|
||||
colour = theme_hash_attrs(from);
|
||||
if (flags & NO_ME || (!(flags & NO_ME) && prefs_get_boolean(PREF_COLOR_NICK_OWN))) {
|
||||
colour = theme_hash_attrs(from);
|
||||
}
|
||||
}
|
||||
prefs_free_string(color_pref);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user