Apply colour stripping (cmode +c) to messages to @/+ channel as well.

This commit is contained in:
Jilles Tjoelker 2012-03-14 23:04:30 +01:00
parent 755c144eb6
commit 60dd1febe2

View file

@ -630,6 +630,7 @@ static void
msg_channel_flags(int p_or_n, const char *command, struct Client *client_p,
struct Client *source_p, struct Channel *chptr, int flags, const char *text)
{
char text2[BUFSIZE];
int type;
char c;
@ -651,6 +652,21 @@ msg_channel_flags(int p_or_n, const char *command, struct Client *client_p,
source_p->localClient->last = rb_current_time();
}
if(chptr->mode.mode & MODE_NOCOLOR)
{
rb_strlcpy(text2, text, BUFSIZE);
strip_colour(text2);
text = text2;
if (EmptyString(text))
{
/* could be empty after colour stripping and
* that would cause problems later */
if(p_or_n != NOTICE)
sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name);
return;
}
}
sendto_channel_flags(client_p, type, source_p, chptr, "%s %c%s :%s",
command, c, chptr->chname, text);
}