Split on <> in colorMentions

This allows it to color the nick in the common case of pasting "<nick>
something they said" into the chat. Technically it should color the
brackets too but that would be too much work.
master
C. McEnroe 2020-02-10 20:58:14 -05:00
parent 2c2839e6c1
commit 36e0bbc4cd
1 changed files with 2 additions and 2 deletions

View File

@ -510,11 +510,11 @@ static const char *colorMentions(size_t id, struct Message *msg) {
if (!str) err(EX_OSERR, "fmemopen"); if (!str) err(EX_OSERR, "fmemopen");
while (*mention) { while (*mention) {
size_t skip = strspn(mention, ", "); size_t skip = strspn(mention, ",<> ");
fwrite(mention, skip, 1, str); fwrite(mention, skip, 1, str);
mention += skip; mention += skip;
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); fprintf(str, "\3%02d%s\3", completeColor(id, mention), mention);