X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/4d64f9c6792b3488be8f61c9b7f829603549e28b..80e32fcd996025093c28b304d91d376b72c1496e:/localuser/localuser.c diff --git a/localuser/localuser.c b/localuser/localuser.c index 33aeb816..9e056b95 100644 --- a/localuser/localuser.c +++ b/localuser/localuser.c @@ -205,7 +205,7 @@ int renamelocaluser(nick *np, char *newnick) { /* Case only name change */ strncpy(np->nick,newnick,NICKLEN); np->nick[NICKLEN]='\0'; - irc_send("%s N %s %jd",iptobase64(ipbuf, &(np->p_ipaddr), sizeof(ipbuf), 1),np->nick,(intmax_t)np->timestamp); + irc_send("%s N %s %jd",iptobase64(ipbuf, &(np->ipaddress), sizeof(ipbuf), 1),np->nick,(intmax_t)np->timestamp); triggerhook(HOOK_NICK_RENAME,harg); return 0; } else { @@ -312,7 +312,7 @@ void sendnickmsg(nick *np) { irc_send("%s N %s 1 %ld %s %s %s%s%s %s %s :%s", mynumeric->content,np->nick,np->timestamp,np->ident,np->host->name->content, - printflags(np->umodes,umodeflags),operbuf,accountbuf,iptobase64(ipbuf,&(np->p_ipaddr), + printflags(np->umodes,umodeflags),operbuf,accountbuf,iptobase64(ipbuf,&(np->ipaddress), sizeof(ipbuf),1),numericbuf,np->realname->name->content); } @@ -364,7 +364,7 @@ int handlemessageornotice(void *source, int cargc, char **cargv, int isnotice) { char *ch; char targetnick[NICKLEN+1]; int foundat; - void *nargs[2]; + void *nargs[3]; int i; /* Should have target and message */ @@ -372,15 +372,23 @@ int handlemessageornotice(void *source, int cargc, char **cargv, int isnotice) { return CMD_OK; } - if (cargv[0][0]=='#' || cargv[0][0]=='+') { - /* Channel message/notice */ - return CMD_OK; - } - if ((sender=getnickbynumericstr((char *)source))==NULL) { Error("localuser",ERR_WARNING,"PRIVMSG from non existant user %s",(char *)source); return CMD_OK; } + + freesstring(sender->message); + sender->message = getsstring(cargv[1], 512); + + nargs[0] = sender; + nargs[1] = cargv[1]; + nargs[2] = (void *)(uintptr_t)isnotice; + triggerhook(HOOK_NICK_MESSAGE, nargs); + + if (cargv[0][0]=='#' || cargv[0][0]=='+') { + /* Channel message/notice */ + return CMD_OK; + } /* Check for a "secure" message (foo@bar) */ foundat=0;