} nickserv_conf;
struct pendingLOCUser {
- char numeric[COMBO_NUMERIC_LEN+1];
+ struct handle_info *handle_info;
unsigned long time;
struct authlogEntry *authlog;
struct pendingLOCUser *next;
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;
tbl.contents[i][1] = ptr;
if(authlog->logout_time)
str = intervalString(intervalBuf, now - authlog->logout_time, hi);
- else
- str = (authlog->user ? "Never" : "Unknown");
+ else if(!authlog->user)
+ str = "Unknown";
+ else {
+ sprintf(intervalBuf, "Never (%s)", authlog->user->nick);
+ str = intervalBuf;
+ }
ptr = malloc(strlen(str)+1);
strcpy(ptr, str);
tbl.contents[i][2] = ptr;
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;
+ free((char*) pending->authlog->hostmask);
+ pending->authlog->hostmask = generate_hostmask(user, GENMASK_USENICK|GENMASK_STRICT_IDENT|GENMASK_NO_HIDING|GENMASK_STRICT_HOST);
+ 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;