From ed1e7515bf56dfbe678d8f9e660e647dc8eb3443 Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 10 Jan 2012 16:49:55 +0100 Subject: [PATCH] we can NOT use the numerics used by LOC - great work OGN DEV --- src/nickserv.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/nickserv.c b/src/nickserv.c index 31ee22f..768148f 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -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; -- 2.20.1