mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-10 11:23:12 +02:00
Added set::anti-spam-quit-message-time idea from hybrid7
This commit is contained in:
@@ -759,3 +759,4 @@ seen. gmtime warning still there
|
||||
- Removed some obsolete code
|
||||
- Added set::oper-only-stats which allows you to set any/all stats as oper only (* = all). Code is kind of
|
||||
ugly since some flags are case insensitive and C == H but it works and seems pretty fast.
|
||||
- Added set::anti-spam-quit-message-time idea from hybrid7
|
||||
|
||||
+2
-1
@@ -68,6 +68,7 @@ struct zConfiguration {
|
||||
char *oper_only_stats;
|
||||
int socksbantime;
|
||||
int maxchannelsperuser;
|
||||
int anti_spam_quit_message_time;
|
||||
char *socksbanmessage;
|
||||
char *socksquitmessage;
|
||||
aNetwork network;
|
||||
@@ -95,7 +96,7 @@ extern aConfiguration iConf;
|
||||
#define NAME_SERVER iConf.name_server
|
||||
#define IDENT_CHECK iConf.ident_check
|
||||
#define OPER_ONLY_STATS iConf.oper_only_stats
|
||||
|
||||
#define ANTI_SPAM_QUIT_MSG_TIME iConf.anti_spam_quit_message_time
|
||||
|
||||
#define ircnetwork iConf.network.x_ircnetwork
|
||||
#define ircnet005 iConf.network.x_ircnet005
|
||||
|
||||
@@ -2142,6 +2142,9 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
|
||||
else if (!strcmp(cep->ce_varname, "oper-auto-join")) {
|
||||
ircstrdup(OPER_AUTO_JOIN_CHANS, cep->ce_vardata);
|
||||
}
|
||||
else if (!strcmp(cep->ce_varname, "anti-spam-quit-message-time")) {
|
||||
ANTI_SPAM_QUIT_MSG_TIME = atime(cep->ce_vardata);
|
||||
}
|
||||
else if (!strcmp(cep->ce_varname, "socks")) {
|
||||
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next) {
|
||||
if (!strcmp(cepp->ce_varname, "ban-message")) {
|
||||
@@ -3763,6 +3766,8 @@ void report_dynconf(aClient *sptr)
|
||||
if (OPER_ONLY_STATS)
|
||||
sendto_one(sptr, ":%s %i %s :oper-only-stats: %s", me.name, RPL_TEXT,
|
||||
sptr->name, OPER_ONLY_STATS);
|
||||
sendto_one(sptr, ":%s %i %s :anti-spam-quit-message-time: %d", me.name, RPL_TEXT,
|
||||
sptr->name, ANTI_SPAM_QUIT_MSG_TIME);
|
||||
sendto_one(sptr, ":%s %i %s :options::show-opermotd: %d", me.name, RPL_TEXT,
|
||||
sptr->name, SHOWOPERMOTD);
|
||||
sendto_one(sptr, ":%s %i %s :options::hide-ulines: %d", me.name, RPL_TEXT,
|
||||
|
||||
@@ -3086,6 +3086,9 @@ int m_quit(cptr, sptr, parc, parv)
|
||||
#ifdef CENSOR_QUIT
|
||||
ocomment = (char *)stripbadwords_channel(ocomment);
|
||||
#endif
|
||||
if (!IsAnOper(sptr) && ANTI_SPAM_QUIT_MSG_TIME)
|
||||
if (sptr->firsttime+ANTI_SPAM_QUIT_MSG_TIME > TStime())
|
||||
ocomment = parv[0];
|
||||
strncpy(comment + strlen(comment), ocomment, TOPICLEN - 7);
|
||||
comment[TOPICLEN] = '\0';
|
||||
return exit_client(cptr, sptr, sptr, comment);
|
||||
|
||||
Reference in New Issue
Block a user