nick **nh;
char *fakehost;
char *accountts;
+ char *accountflags;
struct irc_in_addr ipaddress;
char *accountid;
unsigned long userid;
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);
+ node_increment_usercount(np->ipnode);
np->shident=NULL;
np->sethost=NULL;
*accountts++='\0';
np->accountts=strtoul(accountts,&accountid,10);
if(accountid) {
- userid=strtoul(accountid + 1,NULL,10);
+ userid=strtoul(accountid + 1,&accountflags,10);
if(!userid) {
np->auth=NULL;
} else {
- np->auth=findorcreateauthname(userid);
+ np->auth=findorcreateauthname(userid, cargv[6]);
np->auth->usercount++;
np->nextbyauthname=np->auth->nicks;
np->auth->nicks=np;
+ if(accountflags)
+ np->auth->flags=strtoul(accountflags + 1,NULL,10);
}
} else {
np->auth=NULL;
nick *np;
void *harg[2];
- if (cargc>1) {
- harg[1]=(void *)cargv[1];
+ if (cargc>0) {
+ harg[1]=(void *)cargv[0];
} else {
harg[1]="";
}
if(!userid) {
target->auth=NULL;
} else {
- target->auth=findorcreateauthname(userid);
+ target->auth=findorcreateauthname(userid, target->authname);
target->auth->usercount++;
target->nextbyauthname = target->auth->nicks;
target->auth->nicks = target;
+ if (cargc>=5)
+ target->auth->flags=strtoul(cargv[4],NULL,10);
}
} else {
target->auth=NULL;
return CMD_OK;
}
+
+int handleprivmsg(void *source, int cargc, char **cargv) {
+ nick *sender;
+ char *message;
+ void *args[3];
+
+ if (cargc<2)
+ return CMD_OK;
+
+ if (cargv[0][0]!='$')
+ return CMD_OK;
+
+ sender=getnickbynumericstr((char *)source);
+
+ if (!match2strings(cargv[0] + 1,myserver->content))
+ return CMD_OK;
+
+ message=cargv[0];
+
+ args[0]=sender;
+ args[1]=cargv[0];
+ args[2]=cargv[1];
+
+ triggerhook(HOOK_NICK_MASKPRIVMSG, (void *)args);
+
+ return CMD_OK;
+}
+