]> jfr.im git - irc/quakenet/newserv.git/blobdiff - glines/glines_commands.c
whowas: Use a ring buffer for the whowas records.
[irc/quakenet/newserv.git] / glines / glines_commands.c
index 2d8f05237ed5f1011f4385c0f78fd66a7a3bff89..1148b5a63f43d007130425c8e4e1163bf03110e5 100644 (file)
@@ -64,7 +64,7 @@ invalid:
 
 static int glines_cmdblock(void *source, int cargc, char **cargv) {
   nick *sender = source;
-  nick *target;
+  nick *target, *wnp;
   whowas *ww;
   int hits, duration, id;
   int coff, overridesanity, overridelimit, simulate, chase;
@@ -104,7 +104,7 @@ static int glines_cmdblock(void *source, int cargc, char **cargv) {
     controlreply(sender, "Found matching whowas record:");
     controlreply(sender, "%s", whowas_format(ww));
   } else {
-    ww = whowas_fromnick(target);
+    ww = whowas_fromnick(target, 1);
     ownww = 1;
   }
 
@@ -141,7 +141,10 @@ static int glines_cmdblock(void *source, int cargc, char **cargv) {
   glinebufcounthits(&gbuf, &hits, NULL);
   id = glinebufcommit(&gbuf, 1);
 
-  controlwall(NO_OPER, NL_GLINES, "%s BLOCK'ed user '%s!%s@%s' for %s with reason '%s' (%d hits)", controlid(sender), ww->nick->nick, ww->nick->ident, ww->nick->host->name->content, longtoduration(duration, 0), reason, hits);
+  wnp = &ww->nick;
+  controlwall(NO_OPER, NL_GLINES, "%s BLOCK'ed user '%s!%s@%s' for %s with reason '%s' (%d hits)", controlid(sender),
+              wnp->nick, wnp->ident, wnp->host->name->content,
+              longtoduration(duration, 0), reason, hits);
 
   if (ownww)
     whowas_free(ww);