/* Case only name change */
strncpy(np->nick,newnick,NICKLEN);
np->nick[NICKLEN]='\0';
- irc_send("%s N %s %d",iptobase64(ipbuf, &(np->p_ipaddr), sizeof(ipbuf), 1),np->nick,np->timestamp);
+ irc_send("%s N %s %jd",iptobase64(ipbuf, &(np->p_ipaddr), sizeof(ipbuf), 1),np->nick,(intmax_t)np->timestamp);
triggerhook(HOOK_NICK_RENAME,np);
return 0;
} else {
strncpy(np->nick,newnick,NICKLEN);
np->nick[NICKLEN]='\0';
addnicktohash(np);
- irc_send("%s N %s %d",longtonumeric(np->numeric,5),np->nick,np->timestamp);
+ irc_send("%s N %s %jd",longtonumeric(np->numeric,5),np->nick,(intmax_t)np->timestamp);
triggerhook(HOOK_NICK_RENAME,np);
return 0;
void _killuser(nick *source, nick *target, char *reason) {
char senderstr[6];
char sourcestring[HOSTLEN+NICKLEN+3];
+ char reasonstr[512];
+ void *args[2];
if (!source) {
/* If we have a null nick, use the server.. */
sprintf(sourcestring,"%s!%s",source->host->name->content, source->nick);
}
- irc_send("%s D %s :%s (%s)",senderstr,longtonumeric(target->numeric,5),sourcestring,reason);
+ snprintf(reasonstr,512,"%s (%s)",sourcestring,reason);
+ reasonstr[511]='\0';
+
+ irc_send("%s D %s :%s",senderstr,longtonumeric(target->numeric,5),reasonstr);
+
+ args[0]=target;
+ args[1]=reasonstr;
+ triggerhook(HOOK_NICK_KILL, args);
+
deletenick(target);
}
}
void sendaccountmessage(nick *np) {
- if (connected) {
+ if (connected && IsAccount(np)) {
if (np->auth) {
if (np->auth->flags) {
irc_send("%s AC %s %s %ld %lu %"PRIu64,mynumeric->content, longtonumeric(np->numeric,5), np->authname, np->accountts, np->auth->userid, np->auth->flags);
arg[1] = &oldflags;
anp->flags = accountflags;
- for(np=anp->nicks;np;np=np->next)
+ for(np=anp->nicks;np;np=np->nextbyauthname)
sendaccountmessage(np);
triggerhook(HOOK_AUTH_FLAGSUPDATED, arg);