]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-topic.c
CHANSERV: fix issue where chanserv_relay doesn't wait for db to be loaded before...
[irc/quakenet/newserv.git] / newsearch / ns-topic.c
index 29f52938b6162cca8f9991dcf838f21efd92e169..4bb44f5c72c4a64db6ad9cd95540b46efe209704 100644 (file)
@@ -7,17 +7,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void *topic_exe(struct searchNode *thenode, void *theinput);
-void topic_free(struct searchNode *thenode);
+void *topic_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
+void topic_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *topic_parse(int type, int argc, char **argv) {
+struct searchNode *topic_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (type != SEARCHTYPE_CHANNEL) {
-    parseError = "topic: 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.";
@@ -32,7 +27,7 @@ struct searchNode *topic_parse(int type, int argc, char **argv) {
   return thenode;
 }
 
-void *topic_exe(struct searchNode *thenode, void *theinput) {
+void *topic_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   chanindex *cip = (chanindex *)theinput;
   
   if ((cip->channel==NULL) || (cip->channel->topic==NULL))
@@ -41,7 +36,7 @@ void *topic_exe(struct searchNode *thenode, void *theinput) {
     return cip->channel->topic->content;
 }
 
-void topic_free(struct searchNode *thenode) {
+void topic_free(searchCtx *ctx, struct searchNode *thenode) {
   free(thenode);
 }