]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-kick.c
LUA: add function for channel chanop notice
[irc/quakenet/newserv.git] / newsearch / ns-kick.c
index 67ad49f9009f5cc3d18a7195309f804659107e8c..0b168a83b147337be2954b7c66f08721912bb281 100644 (file)
 void *kick_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
 void kick_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *kick_parse(searchCtx *ctx, int type, int argc, char **argv) {
-  struct searchNode *thenode;
+struct searchNode *kick_parse(searchCtx *ctx, int argc, char **argv) {
+  struct searchNode *thenode, *kicknick;
   nick *np;
+  char *p;
   
-  if (type!=SEARCHTYPE_CHANNEL) {
-    parseError="kick: only channel searches are supported";
-    return NULL;
-  }
-
   if (argc!=1) {
     parseError="kick: usage: (kick target)";
     return NULL;
   }
 
-  if ((np=getnickbynick(argv[0]))==NULL) {
+  if (!(kicknick=argtoconststr("kick", ctx, argv[0], &p)))
+    return NULL;
+  
+  np=getnickbynick(p);
+  kicknick->free(ctx, kicknick);
+  
+  if (np==NULL) {
     parseError="kick: unknown nickname";
     return NULL;
   }