]> jfr.im git - irc/quakenet/newserv.git/commitdiff
noperserv/nterfacer_control now use getauthbyname instead of linear search.
authorChris Porter <redacted>
Fri, 30 May 2008 19:56:01 +0000 (19:56 +0000)
committerChris Porter <redacted>
Fri, 30 May 2008 19:56:01 +0000 (19:56 +0000)
noperserv/noperserv.c
nterfacer/nterfacer_control.c

index 9a84ed7ac9541143afd19b8083590c925449b293..70b72ce879cb221c17917c5467effbcd3d6b4b83 100644 (file)
@@ -10,6 +10,7 @@
 #include "../lib/irc_string.h"
 #include "../lib/strlfunc.h"
 #include "../lib/version.h"
+#include "../authext/authext.h"
 #include "noperserv.h"
 #include "noperserv_db.h"
 #include "noperserv_hooks.h"
@@ -164,18 +165,12 @@ int noperserv_hello(void *sender, int cargc, char **cargv) {
     newaccount = np->authname;
   } else {
     if(cargv[0][0] == '#') {
-      nick *np2;
-      for(i=0;i<NICKHASHSIZE;i++)
-        for(np2=nicktable[i];np2;np2=np2->next)
-          if(IsAccount(np2) && !ircd_strcmp(cargv[0] + 1, np2->authname)) {
-            target = np2;
-            newaccount = target->authname;
-            break;
-          }
-      if(!target) {
+      authname *a = getauthbynick(cargv[0] + 1);
+      if(!a) {
         controlreply(np, "Cannot find anyone with that authname on the network.");
         return CMD_ERROR;
       }
+      target = a->nicks;
     } else {
       target = getnickbynick(cargv[0]);
       if(!target) {
index 7ee122b66f59135612bdd6ea8a709542df2779c3..b3c6e79967ad7f489372d1a86a74e854010bf9ef 100644 (file)
@@ -69,7 +69,7 @@ int handle_ison(struct rline *li, int argc, char **argv) {
 int handle_isaccounton(struct rline *li, int argc, char **argv) {
   int i;
   for(i=0;i<argc;i++)
-    if(ri_append(li, "%d", findauthnamebyname(argv[i])?1:0) == BF_OVER)
+    if(ri_append(li, "%d", getauthbyname(argv[i])?1:0) == BF_OVER)
       return ri_error(li, BF_OVER, "Buffer overflow");
 
   return ri_final(li);