]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-notice.c
SearchCtx should contain 'type' - this is to make life easier when defining new searc...
[irc/quakenet/newserv.git] / newsearch / ns-notice.c
index 3c0861f819974b312c50e9acb5e3c11e172d443b..5adeeb7707e4f16ed9b91c0df8ade247156ec048 100644 (file)
@@ -22,11 +22,10 @@ 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(searchCtx *ctx, 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(searchCtx *ctx, 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();
@@ -82,7 +80,7 @@ void *notice_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
 
   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;
@@ -105,7 +103,7 @@ void notice_free(searchCtx *ctx, struct searchNode *thenode) {
 
   localdata = thenode->localdata;
 
-  if (localdata->type == SEARCHTYPE_CHANNEL) {
+  if (ctx->type == SEARCHTYPE_CHANNEL) {
     nickmarker=nextnickmarker();
     for (i=0;i<CHANNELHASHSIZE;i++) {
       for (cip=chantable[i];cip;cip=ncip) {