X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/ba78836de3a5c1fbcba62790da498a971f8ea5b3..f33f3f52f58acdd2b9b6796713ac8f24d9881545:/newsearch/ns-notice.c diff --git a/newsearch/ns-notice.c b/newsearch/ns-notice.c index dfd0121f..5adeeb77 100644 --- a/newsearch/ns-notice.c +++ b/newsearch/ns-notice.c @@ -16,17 +16,16 @@ extern nick *senderNSExtern; -void *notice_exe(struct searchNode *thenode, void *theinput); -void notice_free(struct searchNode *thenode); +void *notice_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput); +void notice_free(searchCtx *ctx, struct searchNode *thenode); struct notice_localdata { unsigned int marker; int count; - int type; char message[NSMAX_NOTICE_LEN]; }; -struct searchNode *notice_parse(int type, int argc, char **argv) { +struct searchNode *notice_parse(searchCtx *ctx, int argc, char **argv) { struct notice_localdata *localdata; struct searchNode *thenode; int len; @@ -36,8 +35,7 @@ struct searchNode *notice_parse(int type, int argc, char **argv) { return NULL; } localdata->count = 0; - localdata->type = type; - if (type == SEARCHTYPE_CHANNEL) + if (ctx->type == SEARCHTYPE_CHANNEL) localdata->marker = nextchanmarker(); else localdata->marker = nextnickmarker(); @@ -75,14 +73,14 @@ struct searchNode *notice_parse(int type, int argc, char **argv) { return thenode; } -void *notice_exe(struct searchNode *thenode, void *theinput) { +void *notice_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) { struct notice_localdata *localdata; nick *np; chanindex *cip; localdata = thenode->localdata; - if (localdata->type == SEARCHTYPE_CHANNEL) { + if (ctx->type == SEARCHTYPE_CHANNEL) { cip = (chanindex *)theinput; cip->marker = localdata->marker; localdata->count += cip->channel->users->totalusers; @@ -96,7 +94,7 @@ void *notice_exe(struct searchNode *thenode, void *theinput) { return (void *)1; } -void notice_free(struct searchNode *thenode) { +void notice_free(searchCtx *ctx, struct searchNode *thenode) { struct notice_localdata *localdata; nick *np, *nnp; chanindex *cip, *ncip; @@ -105,7 +103,7 @@ void notice_free(struct searchNode *thenode) { localdata = thenode->localdata; - if (localdata->type == SEARCHTYPE_CHANNEL) { + if (ctx->type == SEARCHTYPE_CHANNEL) { nickmarker=nextnickmarker(); for (i=0;inick, senderNSExtern->authname, localdata->count, localdata->count != 1 ? "users" : "user", localdata->message); + ctx->wall(NL_BROADCASTS, "%s/%s sent the following message to %d %s: %s", senderNSExtern->nick, senderNSExtern->authname, localdata->count, localdata->count != 1 ? "users" : "user", localdata->message); free(localdata); free(thenode); }