Don't insert color codes for non-mentions

master
C. McEnroe 2020-02-11 18:15:25 -05:00
parent 4d532ec738
commit 6a5ebb0bab
1 changed files with 6 additions and 1 deletions

View File

@ -554,7 +554,12 @@ static const char *colorMentions(size_t id, struct Message *msg) {
size_t len = strcspn(mention, ",<> "); size_t len = strcspn(mention, ",<> ");
char punct = mention[len]; char punct = mention[len];
mention[len] = '\0'; mention[len] = '\0';
fprintf(str, "\3%02d%s\3", completeColor(id, mention), mention); enum Color color = completeColor(id, mention);
if (color != Default) {
fprintf(str, "\3%02d%s\3", color, mention);
} else {
fprintf(str, "%s", mention);
}
mention[len] = punct; mention[len] = punct;
mention += len; mention += len;
} }