]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-oppct.c
fix makefile of jupe module
[irc/quakenet/newserv.git] / newsearch / ns-oppct.c
index d1e0d353719a4a020e696d84db5bf5c405734cf4..7533b8b7f1da6eccf69b5a49d418e456e3f68276 100644 (file)
@@ -13,11 +13,6 @@ void oppct_free(searchCtx *ctx, struct searchNode *thenode);
 struct searchNode *oppct_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (ctx->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);
 }