mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 13:03:13 +02:00
- Fixed an issue where chanmode +f was often set by the server again
in a netjoin when there was no need to (nothing to synch). - Added spamfilter::except which allows you to specify targets (eg: channels) where spamfilter should not take action. Requested by Fury (#0001586). Ex: set { spamfilter { except "#spamreport,#help"; }; };
This commit is contained in:
+16
-1
@@ -107,6 +107,21 @@ aParv *mp2parv(char *xmbuf, char *parmbuf)
|
||||
return (&pparv);
|
||||
}
|
||||
|
||||
/* Checks if 2 ChanFloodProt modes (chmode +f) are different.
|
||||
* This is a bit more complicated than 1 simple memcmp(a,b,..) because
|
||||
* counters are also stored in this struct so we have to do
|
||||
* it manually :( -- Syzop.
|
||||
*/
|
||||
static int compare_floodprot_modes(ChanFloodProt *a, ChanFloodProt *b)
|
||||
{
|
||||
if (memcmp(a->l, b->l, sizeof(a->l)) ||
|
||||
memcmp(a->a, b->a, sizeof(a->a)) ||
|
||||
memcmp(a->r, b->r, sizeof(a->r)))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** m_sjoin
|
||||
**
|
||||
@@ -761,7 +776,7 @@ CMD_FUNC(m_sjoin)
|
||||
char *x;
|
||||
int i;
|
||||
|
||||
if (memcmp(chptr->mode.floodprot, oldmode.floodprot, sizeof(ChanFloodProt)))
|
||||
if (compare_floodprot_modes(chptr->mode.floodprot, oldmode.floodprot))
|
||||
{
|
||||
chptr->mode.floodprot->per = MAX(chptr->mode.floodprot->per, oldmode.floodprot->per);
|
||||
for (i=0; i < NUMFLD; i++)
|
||||
|
||||
@@ -1321,6 +1321,9 @@ int stats_set(aClient *sptr, char *para)
|
||||
sptr->name, SPAMFILTER_BAN_REASON);
|
||||
sendto_one(sptr, ":%s %i %s :spamfilter::virus-help-channel: %s", me.name, RPL_TEXT,
|
||||
sptr->name, SPAMFILTER_VIRUSCHAN);
|
||||
if (SPAMFILTER_EXCEPT)
|
||||
sendto_one(sptr, ":%s %i %s :spamfilter::except: %s", me.name, RPL_TEXT,
|
||||
sptr->name, SPAMFILTER_EXCEPT);
|
||||
sendto_one(sptr, ":%s %i %s :hosts::global: %s", me.name, RPL_TEXT,
|
||||
sptr->name, oper_host);
|
||||
sendto_one(sptr, ":%s %i %s :hosts::admin: %s", me.name, RPL_TEXT,
|
||||
|
||||
Reference in New Issue
Block a user