From be6661d6bef501de8188e94e26d3a51591ef1168 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Tue, 14 Jan 2020 21:43:46 -0500 Subject: [PATCH] Don't assume a potentially-colored reminder unless it's MSG/MSF/CAL type. --- src/calendar.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/calendar.c b/src/calendar.c index f2ff4059..51890bbc 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -1073,15 +1073,7 @@ static int DoCalRem(ParsePtr p, int col) int is_color, col_r, col_g, col_b; - is_color = ( - DefaultColorR != -1 - && DefaultColorG != -1 - && DefaultColorB != -1); - if (is_color) { - col_r = DefaultColorR; - col_g = DefaultColorG; - col_b = DefaultColorB; - } + is_color = 0; DBufInit(&buf); DBufInit(&pre_buf); DBufInit(&raw_buf); @@ -1092,6 +1084,20 @@ static int DoCalRem(ParsePtr p, int col) return r; } + if (trig.typ == MSG_TYPE || + trig.typ == CAL_TYPE || + trig.typ == MSF_TYPE) { + is_color = ( + DefaultColorR != -1 + && DefaultColorG != -1 + && DefaultColorB != -1); + if (is_color) { + col_r = DefaultColorR; + col_g = DefaultColorG; + col_b = DefaultColorB; + } + } + /* Don't include timed reminders in calendar if -a option supplied. */ if (DontIssueAts && tim.ttime != NO_TIME) { FreeTrig(&trig); @@ -1167,7 +1173,8 @@ static int DoCalRem(ParsePtr p, int col) /* If it's a plain reminder but we have a default color, add the three colors to the prebuf and change passthru to "COLOR" */ if (trig.typ == MSG_TYPE || - trig.typ == CAL_TYPE) { + trig.typ == CAL_TYPE || + trig.typ == MSF_TYPE) { if (PsCal && is_color) { char cbuf[24]; sprintf(cbuf, "%d %d %d ", col_r, col_g, col_b);