Esempio n. 1
0
char *h_nocodes_chanmsg(aClient *cptr, aClient *sptr, aChannel *acptr, char *text, int notice)
{
static char retbuf[4096];
        if (IsULine(sptr) || IsServer(sptr)) {
                return text;
        }
        if (IsNoCodes(acptr)) {
		strncpyzt(retbuf, StripControlCodes(text), sizeof(retbuf));
		return retbuf;
        }
        else {
        return text;
        }
}
 int stripcodes_packet(aClient *from, aClient *to, char **msg, int length)
 {
 	static char buf[512];

 	if((from != &me && (!IsClient(from) && IsRegistered(from))) || (to != &me && !IsClient(to)))
 		return HOOK_CONTINUE;

 	if (to != &me && IsColorBlind(to)) {
 		strcpy(buf, StripControlCodes(*msg));

 		length = strlen(buf);
 		*msg = buf;
 	}

 	return HOOK_CONTINUE;
 }
Esempio n. 3
0
char *nocodes_pre_chanmsg(aClient *sptr, aChannel *chptr, char *text, int notice)
{
static char retbuf[4096];

	if (has_channel_mode(chptr, 'S'))
	{
		strlcpy(retbuf, StripControlCodes(text), sizeof(retbuf));
		return retbuf;
	} else
	if (has_channel_mode(chptr, 'c'))
	{
		if (has_controlcodes(text))
		{
			sendto_one(sptr, err_str(ERR_CANNOTSENDTOCHAN),
				me.name, sptr->name, chptr->chname,
				"Control codes (bold/underline/reverse) are not permitted in this channel",
				chptr->chname);
			return NULL;
		} else
			return text;
	} else
		return text;
}