we can NOT use the numerics used by LOC - great work OGN DEV
authorpk910 <philipp@zoelle1.de>
Tue, 10 Jan 2012 15:49:55 +0000 (16:49 +0100)
committerpk910 <philipp@zoelle1.de>
Tue, 10 Jan 2012 15:49:55 +0000 (16:49 +0100)
src/nickserv.c

index 31ee22f2e29b4273d52c526076e4d2900395afac..768148f4a755f6260de4be15a67535cdafd6cade 100644 (file)
@@ -417,7 +417,7 @@ static struct {
 } nickserv_conf;
 
 struct pendingLOCUser {
-    char numeric[COMBO_NUMERIC_LEN+1];
+    struct handle_info *handle_info;
     unsigned long time;
     struct authlogEntry *authlog;
     struct pendingLOCUser *next;
@@ -1974,9 +1974,7 @@ struct handle_info *checklogin(const char *user, const char *pass, const char *n
     struct authlogEntry *authlog = authlog_add(hi, NULL, ptr);
     struct pendingLOCUser *pending;
     if(authlog && (pending = malloc(sizeof(*pending)))) {
-        for(ii = 0; ii < COMBO_NUMERIC_LEN; ii++)
-            pending->numeric[ii] = numeric[ii];
-        pending->numeric[COMBO_NUMERIC_LEN] = '\0';
+        pending->handle_info = hi;
         pending->time = now;
         pending->authlog = authlog;
         pending->next = pendingLOCUsers;
@@ -4680,23 +4678,25 @@ nickserv_reclaim_p(void *data) {
 static void
 check_user_nick(struct userNode *user) {
     //check if this user is a pending LOC user
-    struct pendingLOCUser *pending, *next, *prev = NULL;
-    for(pending = pendingLOCUsers; pending; pending = next) {
-        next = pending->next;
-        if(!strcmp(user->numeric, pending->numeric)) {
-            pending->authlog->user = user;
-            if(prev)
-                prev->next = next;
-            else
-                pendingLOCUsers = next;
-            free(pending);
-        }
-        if(now - pending->time > 10) {
-            if(prev)
-                prev->next = next;
-            else
-                pendingLOCUsers = next;
-            free(pending);
+    if(pendingLOCUsers) {
+        struct pendingLOCUser *pending, *next, *prev = NULL;
+        for(pending = pendingLOCUsers; pending; pending = next) {
+            next = pending->next;
+            if(user->handle_info == pending->handle_info) {
+                pending->authlog->user = user;
+                if(prev)
+                    prev->next = next;
+                else
+                    pendingLOCUsers = next;
+                free(pending);
+            }
+            if(now - pending->time > 10) {
+                if(prev)
+                    prev->next = next;
+                else
+                    pendingLOCUsers = next;
+                free(pending);
+            }
         }
     }
     struct nick_info *ni;