nick **nh;
char *fakehost;
char *accountts;
+ struct irc_in_addr ipaddress;
if (cargc==2) { /* rename */
/* Nyklon 1017697578 */
Error("nick",ERR_WARNING,"Received NICK with invalid numeric %s from %s.",cargv[cargc-2],sender);
return CMD_ERROR;
}
-
+
+ base64toip(cargv[cargc-3], &ipaddress);
+ if (!irc_in_addr_valid(&ipaddress)) {
+ Error("nick",ERR_ERROR,"Received NICK with invalid ipaddress for %s from %s.",cargv[0],sender);
+ return CMD_ERROR;
+ }
+
/* At this stage the nick is cleared to proceed */
np=newnick();
strncpy(np->nick,cargv[0],NICKLEN);
np->nextbyrealname=np->realname->nicks;
np->realname->nicks=np;
np->timestamp=timestamp;
- np->ipaddress=numerictolong(cargv[cargc-3],6);
+
+ base64toip(cargv[cargc-3], &ipaddress);
+ /* todo: use a single node for /64 prefixes */
+ np->ipnode = refnode(iptree, &ipaddress, irc_in_addr_is_ipv4(&ipaddress) ? PATRICIA_MAXBITS : 64);
+
np->shident=NULL;
np->sethost=NULL;
np->umodes=0;
irc_send(":%s 313 %s %s :is an IRC Operator",myserver->content,sender->nick,target->nick);
}
if (IsAccount(target)) {
- irc_send(":%s 330 %s %s %s :is logged in as",myserver->content,sender->nick,target->nick,target->authname);
+ irc_send(":%s 330 %s %s %s :is authed as",myserver->content,sender->nick,target->nick,target->authname);
}
- if (homeserver(target->numeric)==mylongnum && !IsService(target)) {
+ if (homeserver(target->numeric)==mylongnum && !IsService(target) && !IsHideIdle(target)) {
irc_send(":%s 317 %s %s %ld %ld :seconds idle, signon time",myserver->content,sender->nick,target->nick,
- 0,target->timestamp);
+ (getnettime() - target->timestamp) % (((target->numeric + target->timestamp) % 983) + 7),target->timestamp);
}
}
target->authname[ACCOUNTLEN]='\0';
triggerhook(HOOK_NICK_ACCOUNT, (void *)target);
-
+
return CMD_OK;
}