]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Implement notice flag +G for automated gline messages.
authorGunnar Beutner <redacted>
Sat, 27 Jul 2013 18:05:33 +0000 (20:05 +0200)
committerGunnar Beutner <redacted>
Sat, 27 Jul 2013 18:05:33 +0000 (20:05 +0200)
--HG--
branch : shroudtrusts

control/control.h
glines/glines.c
glines/glines_buf.c
glines/glines_formats.c
noperserv/noperserv.c
noperserv/noperserv_policy.h

index a72d2649f2f1e552d849b662eba1fa3d8f25c8ac..dc43662e151e62b52f3a32252a7255d7789f15a5 100644 (file)
@@ -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  
index 8edfc6ddb4006c3e05b2c40680a53182d6d8f5d2..f2b1b7b7ed6ed327b5a31ae7dc989f1348609835 100644 (file)
@@ -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
index d1a8cd30e4b01e44021a0cef3ea4b79478c59e4d..675711e0e4e5488ca6b7d5ae33edc69988f3e4f5 100644 (file)
@@ -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;
   }
index 4e58bccc58637af5cccd3ab742b00a271f5f790c..6a1649fc7dcc962cdd80f29df842926b764cb6a7 100644 (file)
@@ -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;
   }
index d429cf2693ab0957270b13fdb18ca1b0a38b0af4..ae5c3c1062c03079923834e8bbc9753df684e3ca 100644 (file)
@@ -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"
index ccda48aaf661987607b031a967c2bc9f88093a84..9274b31486bc39a1c901951f7dfb12db88832017 100644 (file)
@@ -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