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);