]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-oppct.c
CHANSERV: fix issue where chanserv_relay doesn't wait for db to be loaded before...
[irc/quakenet/newserv.git] / newsearch / ns-oppct.c
index cb44c59b68a03fea33c4e5ebb925e49ebe788989..7533b8b7f1da6eccf69b5a49d418e456e3f68276 100644 (file)
 void *oppct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
 void oppct_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *oppct_parse(searchCtx *ctx, int type, int argc, char **argv) {
+struct searchNode *oppct_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (type != SEARCHTYPE_CHANNEL) {
-    parseError = "oppct: this function is only valid for channel searches.";
-    return NULL;
-  }
-
   if (!(thenode=(struct searchNode *)malloc(sizeof(struct searchNode)))) {
     /* couldn't malloc() memory for thenode, so free localdata to avoid leakage */
     parseError = "malloc: could not allocate memory for this search.";
@@ -44,7 +39,7 @@ void *oppct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   
   for (i=0;i<cip->channel->users->hashsize;i++) {
     if (cip->channel->users->content[i]!=nouser) {
-      if (!(cip->channel->users->content[i] & CUMODE_OP)) {
+      if (cip->channel->users->content[i] & CUMODE_OP) {
         ops++;
       }
     }
@@ -54,6 +49,7 @@ void *oppct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
 }
 
 void oppct_free(searchCtx *ctx, struct searchNode *thenode) {
+  ctx->reply(senderNSExtern, "Notice: oppct is deprecated by cumodepct");
   free(thenode);
 }