]> jfr.im git - irc/quakenet/newserv.git/blobdiff - glines/glines.c
Merge branch 'master' into chanserv-live
[irc/quakenet/newserv.git] / glines / glines.c
index f2b1b7b7ed6ed327b5a31ae7dc989f1348609835..e19559d859b8f43ecd14f25ff47c10006f8bc822 100644 (file)
@@ -15,7 +15,7 @@ void _init() {
   /* If we're connected to IRC, force a disconnect. */
   if (connected) {
     irc_send("%s SQ %s 0 :Resync [adding gline support]", mynumeric->content, myserver->content);
-    irc_disconnected();
+    irc_disconnected(0);
   }
 
   registerserverhandler("GL", handleglinemsg, 6);
@@ -45,7 +45,7 @@ int gline_match_nick(gline *gl, nick *np) {
     return 0;
 
   if (gl->flags & GLINE_IPMASK) {
-    if (!ipmask_check(&gl->ip, &np->p_ipaddr, gl->bits))
+    if (!ipmask_check(&gl->ip, &np->ipaddress, gl->bits))
       return 0;
   } else {
     if (gl->host && match(gl->host->content, np->host->name->content) != 0)
@@ -175,44 +175,26 @@ void gline_propagate(gline *agline) {
       glinetostring(agline), longtoduration(agline->expire-getnettime(), 0),
       agline->reason ? agline->reason->content : "", agline->creator->content);
 
-#if 1
     irc_send("%s GL * %%-%s %lu %lu :%s\r\n", mynumeric->content,
       glinetostring(agline), agline->expire - getnettime(),
       agline->lastmod, agline->reason ? agline->reason->content : "");
-#else
-    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_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 : "");
 
-#if 1
     irc_send("%s GL * +%s %lu %lu :%s\r\n", mynumeric->content,
       glinetostring(agline), agline->expire - getnettime(),
       agline->lastmod, agline->reason ? agline->reason->content : "");
-#else
-    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_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 : "");
 
-#if 1
     irc_send("%s GL * -%s %lu %lu :%s\r\n", mynumeric->content,
       glinetostring(agline), agline->expire - getnettime(),
       agline->lastmod, agline->reason ? agline->reason->content : "");
-#else
-    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
   }
 }
 
@@ -264,9 +246,6 @@ int gline_match_mask(gline *gla, gline *glb) {
   if ((gla->flags & GLINE_REALNAME) != (glb->flags & GLINE_REALNAME))
     return 0;
 
-  if ((gla->flags & GLINE_IPMASK) != (glb->flags & GLINE_IPMASK))
-    return 0;
-
   if (gla->nick && !glb->nick)
     return 0;
 
@@ -279,7 +258,7 @@ int gline_match_mask(gline *gla, gline *glb) {
   if (gla->user && glb->user && match(gla->user->content, glb->user->content) != 0)
     return 0;
 
-  if (gla->flags & GLINE_IPMASK) {
+  if (gla->flags & GLINE_IPMASK && glb->flags & GLINE_IPMASK) {
     if (gla->bits > glb->bits)
       return 0;