]> jfr.im git - irc/quakenet/newserv.git/blobdiff - glines/glines_buf.c
nickwatch: Add hook for HOOK_NICK_ACCOUNT.
[irc/quakenet/newserv.git] / glines / glines_buf.c
index 63f048914889fb99437890c93e2a5e446ff72ce0..9ee2288f7bac39505dbea329462ec6916e768981 100644 (file)
@@ -90,7 +90,19 @@ void glinebufaddbynick(glinebuf *gbuf, nick *np, int flags, const char *creator,
     snprintf(mask, sizeof(mask), "%s!*@*", np->nick);
     glinebufadd(gbuf, mask, creator, reason, expire, lastmod, lifetime);
   } else {
-    glinebufaddbyip(gbuf, np->ident, &np->p_ipaddr, 128, flags, creator, reason, expire, lastmod, lifetime);
+    glinebufaddbyip(gbuf, np->ident, &np->ipaddress, 128, flags, creator, reason, expire, lastmod, lifetime);
+  }
+}
+
+void glinebufaddbywhowas(glinebuf *gbuf, whowas *ww, int flags, const char *creator, const char *reason, time_t expire, time_t lastmod, time_t lifetime) {
+  nick *np = &ww->nick;
+
+  if (flags & GLINE_ALWAYS_NICK) {
+    char mask[512];
+    snprintf(mask, sizeof(mask), "%s!*@*", np->nick);
+    glinebufadd(gbuf, mask, creator, reason, expire, lastmod, lifetime);
+  } else {
+    glinebufaddbyip(gbuf, np->ident, &np->ipaddress, 128, flags, creator, reason, expire, lastmod, lifetime);
   }
 }