From: Gunnar Beutner Date: Sat, 27 Jul 2013 18:05:33 +0000 (+0200) Subject: Implement notice flag +G for automated gline messages. X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/4e52c61dcb5a5c1bfd684b217c39a28381b6275d?hp=a825c59a6efee29ed3b9d741772fd570c5f3ac61 Implement notice flag +G for automated gline messages. --HG-- branch : shroudtrusts --- diff --git a/control/control.h b/control/control.h index a72d2649..dc43662e 100644 --- a/control/control.h +++ b/control/control.h @@ -99,5 +99,6 @@ char *controlid(nick *); #define NL_OPERING 0x0800 /* when someone opers */ #define NL_NOTICES 0x1000 /* turn off to receive privmsgs instead of notices */ #define NL_ALL_COMMANDS 0x2000 /* every single command sent */ +#define NL_GLINES_AUTO 0x4000 /* automated gline messages */ #endif diff --git a/glines/glines.c b/glines/glines.c index 8edfc6dd..f2b1b7b7 100644 --- a/glines/glines.c +++ b/glines/glines.c @@ -169,9 +169,9 @@ void gline_propagate(gline *agline) { if (agline->flags & GLINE_DESTROYED) { #if SNIRCD_VERSION < 135 - controlwall(NO_OPER, NL_GLINES, "Tried to destroy G-Line on '%s' however SNIRCD_VERSION is too old.", glinetostring(agline)); + controlwall(NO_OPER, NL_GLINES_AUTO, "Tried to destroy G-Line on '%s' however SNIRCD_VERSION is too old.", glinetostring(agline)); #else - controlwall(NO_OPER, NL_GLINES, "Destroying G-Line on '%s' lasting %s with reason '%s', created by: %s", + controlwall(NO_OPER, NL_GLINES_AUTO, "Destroying G-Line on '%s' lasting %s with reason '%s', created by: %s", glinetostring(agline), longtoduration(agline->expire-getnettime(), 0), agline->reason ? agline->reason->content : "", agline->creator->content); @@ -180,13 +180,13 @@ void gline_propagate(gline *agline) { glinetostring(agline), agline->expire - getnettime(), agline->lastmod, agline->reason ? agline->reason->content : ""); #else - controlwall(NO_OPER, NL_GLINES, "%s GL * %%-%s %lu %lu :%s\r\n", mynumeric->content, + controlwall(NO_OPER, NL_GLINES_AUTO, "%s GL * %%-%s %lu %lu :%s\r\n", mynumeric->content, glinetostring(agline), agline->expire - getnettime(), agline->lastmod, agline->reason ? agline->reason->content : ""); #endif #endif /* SNIRCD_VERSION */ } else if (agline->flags & GLINE_ACTIVE) { - controlwall(NO_OPER, NL_GLINES, "Activating G-Line on '%s' lasting %s created by %s with reason '%s'", + controlwall(NO_OPER, NL_GLINES_AUTO, "Activating G-Line on '%s' lasting %s created by %s with reason '%s'", glinetostring(agline), longtoduration(agline->expire-getnettime(), 0), agline->creator->content, agline->reason ? agline->reason->content : ""); @@ -195,12 +195,12 @@ void gline_propagate(gline *agline) { glinetostring(agline), agline->expire - getnettime(), agline->lastmod, agline->reason ? agline->reason->content : ""); #else - controlwall(NO_OPER, NL_GLINES, "%s GL * +%s %lu %lu :%s\r\n", mynumeric->content, + controlwall(NO_OPER, NL_GLINES_AUTO, "%s GL * +%s %lu %lu :%s\r\n", mynumeric->content, glinetostring(agline), agline->expire - getnettime(), agline->lastmod, agline->reason ? agline->reason->content : ""); #endif } else { - controlwall(NO_OPER, NL_GLINES, "Deactivating G-Line on '%s' lasting %s created by %s with reason '%s'", + controlwall(NO_OPER, NL_GLINES_AUTO, "Deactivating G-Line on '%s' lasting %s created by %s with reason '%s'", glinetostring(agline), longtoduration(agline->expire-getnettime(), 0), agline->creator->content, agline->reason ? agline->reason->content : ""); @@ -209,7 +209,7 @@ void gline_propagate(gline *agline) { glinetostring(agline), agline->expire - getnettime(), agline->lastmod, agline->reason ? agline->reason->content : ""); #else - controlwall(NO_OPER, NL_GLINES, "%s GL * -%s %lu %lu :%s\r\n", mynumeric->content, + controlwall(NO_OPER, NL_GLINES_AUTO, "%s GL * -%s %lu %lu :%s\r\n", mynumeric->content, glinetostring(agline), agline->expire - getnettime(), agline->lastmod, agline->reason ? agline->reason->content : ""); #endif diff --git a/glines/glines_buf.c b/glines/glines_buf.c index d1a8cd30..675711e0 100644 --- a/glines/glines_buf.c +++ b/glines/glines_buf.c @@ -298,7 +298,7 @@ int glinebufcommit(glinebuf *gbuf, int propagate) { glinebufcounthits(gbuf, &users, &channels); if (propagate && (users > MAXGLINEUSERHITS || channels > MAXGLINECHANNELHITS)) { - controlwall(NO_OPER, NL_GLINES, "G-Line buffer would hit %d users/%d channels. Not setting G-Lines."); + controlwall(NO_OPER, NL_GLINES_AUTO, "G-Line buffer would hit %d users/%d channels. Not setting G-Lines."); glinebufabort(gbuf); return 0; } diff --git a/glines/glines_formats.c b/glines/glines_formats.c index 4e58bccc..6a1649fc 100644 --- a/glines/glines_formats.c +++ b/glines/glines_formats.c @@ -104,7 +104,7 @@ gline *makegline(const char *mask) { count++; if (count >= 8) { - controlwall(NO_OPER, NL_GLINES, "Warning: Parsed invalid IPv6 G-Line: %s", mask); + controlwall(NO_OPER, NL_GLINES_AUTO, "Warning: Parsed invalid IPv6 G-Line: %s", mask); freegline(gl); return NULL; } diff --git a/noperserv/noperserv.c b/noperserv/noperserv.c index d429cf26..ae5c3c10 100644 --- a/noperserv/noperserv.c +++ b/noperserv/noperserv.c @@ -59,6 +59,7 @@ const flag no_noticeflags[] = { { 'k', NL_KICKKILLS }, /* KICK/KILL commands */ { 'I', NL_MISC }, /* misc commands */ { 'g', NL_GLINES }, /* GLINE commands */ + { 'G', NL_GLINES_AUTO }, /* automated gline messages */ { 'h', NL_HITS }, /* Where a gline or kill is set automatically by the bot */ { 'c', NL_CLONING }, /* Clone detection */ { 'C', NL_CLEARCHAN }, /* When someone clearchans */ @@ -115,6 +116,7 @@ void _init() { " +t: Trusts\n" " +k: KICK/KILL commands\n" " +g: GLINE commands\n" + " +G: automated gline messages\n" " +h: Shows when glines are set by code (hits)\n" " +c: Clone information\n" " +C: CLEARCHAN command\n" diff --git a/noperserv/noperserv_policy.h b/noperserv/noperserv_policy.h index ccda48aa..9274b314 100644 --- a/noperserv/noperserv_policy.h +++ b/noperserv/noperserv_policy.h @@ -25,8 +25,8 @@ flag_t noperserv_policy_permitted_modifications(no_autheduser *au, no_autheduser #define NOIsLeastRelay(user) (NOGetAuthLevel(user) & (__NO_DEVELOPER | __NO_RELAY)) #define NL_PEONIC_FLAGS NL_NOTICES -#define NL_ALL NL_MANAGEMENT | NL_TRUSTS | NL_KICKKILLS | NL_MISC | NL_GLINES | NL_HITS | NL_CLONING | NL_CLEARCHAN | NL_FAKEUSERS | NL_BROADCASTS | NL_OPERATIONS | NL_OPERING | NL_ALL_COMMANDS -#define NL_OPER_FLAGS NL_MANAGEMENT | NL_TRUSTS | NL_KICKKILLS | NL_MISC | NL_GLINES | NL_HITS | NL_CLONING | NL_CLEARCHAN | NL_FAKEUSERS | NL_BROADCASTS | NL_OPERATIONS | NL_OPERING +#define NL_ALL NL_MANAGEMENT | NL_TRUSTS | NL_KICKKILLS | NL_MISC | NL_GLINES | NL_GLINES_AUTO | NL_HITS | NL_CLONING | NL_CLEARCHAN | NL_FAKEUSERS | NL_BROADCASTS | NL_OPERATIONS | NL_OPERING | NL_ALL_COMMANDS +#define NL_OPER_FLAGS NL_MANAGEMENT | NL_TRUSTS | NL_KICKKILLS | NL_MISC | NL_GLINES | NL_GLINES_AUTO | NL_HITS | NL_CLONING | NL_CLEARCHAN | NL_FAKEUSERS | NL_BROADCASTS | NL_OPERATIONS | NL_OPERING #define NL_SEC_FLAGS NL_CLONING #define NL_TRUST_FLAGS NL_TRUSTS | NL_CLONING #define NL_DEV_FLAGS NL_ALL_COMMANDS