]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Backed out changeset 54fd10e592e2 - this included more changes than were
authorsplidge <redacted>
Wed, 2 Apr 2008 14:41:58 +0000 (15:41 +0100)
committersplidge <redacted>
Wed, 2 Apr 2008 14:41:58 +0000 (15:41 +0100)
intended.

chanserv/newsearch/csns-qchanflags.c
irc/irc.c
newsearch/newsearch.c
newsearch/ns-gline.c

index b14bd8129b841b71fc26c1f6d71fa415a25b87a6..39f098ff7271de287d0421bbf756d4f1514f5598 100644 (file)
@@ -43,8 +43,8 @@ struct searchNode *qchanflags_parse(searchCtx *ctx, int type, int argc, char **a
     localdata->setmodes=0;
     localdata->clearmodes=~0;
     
-    setflags(&(localdata->setmodes), QCFLAG_ALL, argv[0], rcflags, REJECT_NONE);
-    setflags(&(localdata->clearmodes), QCFLAG_ALL, argv[0], rcflags, REJECT_NONE);
+    setflags(&(localdata->setmodes), QCFLAG_ALL, argv[0], rcuflags, REJECT_NONE);
+    setflags(&(localdata->clearmodes), QCFLAG_ALL, argv[0], rcuflags, REJECT_NONE);
     
     localdata->clearmodes = ~localdata->clearmodes;
   }
index d2cffb3f93d3f21f914ff3bc69564cc6bf6b7975..cf35fec2ec37504feca707c96e35221565c68376 100644 (file)
--- a/irc/irc.c
+++ b/irc/irc.c
@@ -30,8 +30,6 @@ MODULE_VERSION("");
 #define MIN_NUMERIC          100
 #define MAX_NUMERIC          999
 
-#define IRC_DUMP
-
 void irc_connect(void *arg);
 
 CommandTree *servercommands;
@@ -217,12 +215,7 @@ void irc_send(char *format, ... ) {
   
   buf[len++]='\r';
   buf[len++]='\n';
-
-#ifdef IRC_DUMP
-  buf[len]='\0';
-  printf(">> %s",buf);
-#endif
-
+  
   write(serverfd,buf,len);
 }
 
@@ -301,10 +294,6 @@ int parseline() {
   
   /* OK, currentline points at a valid NULL-terminated line */
   /* and nextline points at where we are going next */      
-
-#ifdef IRC_DUMP
-  printf("<< %s\n",currentline);
-#endif
   
   linesreceived++;
 
index 50fed1785367660aac20920564f794c24eafd15d..911df297993d791bd267f58c91a7ea57339f97d0 100644 (file)
@@ -155,54 +155,6 @@ void deregistersearchterm(char *term, parseFunc parsefunc) {
   deletecommandfromtree(searchTree, term, (CommandHandler) parsefunc);
 }
 
-#define SHOWFUNCLIST_MAXCMDS   300
-
-void printcmdlist(replyFunc reply, void *source, struct Command **thecmds, int numcmds) {
-  unsigned int i;
-  char buf[512];
-  int bufpos=0;
-  
-  for (i=0;i<numcmds;i++) {
-    if (bufpos+thecmds[i]->command->length > 300) {
-      reply(source, "%s", buf);
-      bufpos=0;
-    }
-    
-    bufpos+=sprintf(buf+bufpos, "%s%s", bufpos?", ":"", thecmds[i]->command->content);
-  }
-  
-  reply(source, "%s", buf);
-}
-
-/* showfunclist: dump a list of valid functions and output formats */
-void showfunclist(replyFunc reply, void *source, CommandTree *outputs) {
-  struct Command *thecmds[SHOWFUNCLIST_MAXCMDS];
-  int ncmds;
-
-  reply(source, "Usage: *SEARCH <opts> <search terms>");
-  reply(source, "Valid options:");
-  reply(source, " -l <num>     Limits output to <num> matches");
-  reply(source, " -d <format>  Selects named output format");
-  reply(source, "<search terms> is a lisp-style string describing what you want to match.  Function calls");
-  reply(source, "consist of parentheses with a space separated list of arguments, the function name");
-  reply(source, "being the first argument.  For example:");
-  reply(source, "*search (match (name) *trout*)  will return the list of objects named *trout*");
-  reply(source, "*search (and (match (name) *trout*) (modes +r)) will return the list of objects");
-  reply(source, "     named *trout* with mode +r set");
-  
-  ncmds=getcommandlist(searchTree, thecmds, SHOWFUNCLIST_MAXCMDS);
-  if (ncmds) {
-    reply(source, "Valid search functions:");
-    printcmdlist(reply, source, thecmds, ncmds);
-  }
-  
-  ncmds=getcommandlist(outputs, thecmds, SHOWFUNCLIST_MAXCMDS);
-  if (ncmds) {
-    reply(source, "Valid output functions for this search type:");
-    printcmdlist(reply, source, thecmds, ncmds);
-  }
-}
-
 static void controlwallwrapper(int level, char *format, ...) {
   char buf[1024];
   va_list ap;
@@ -271,7 +223,7 @@ int do_nicksearch_real(replyFunc reply, wallFunc wall, void *source, int cargc,
     return ret;
 
   if (arg>=cargc) {
-    showfunclist(reply, source, nickOutputTree);
+    reply(sender,"No search terms - aborting.");
     return CMD_ERROR;
   }
 
@@ -359,7 +311,7 @@ int do_chansearch_real(replyFunc reply, wallFunc wall, void *source, int cargc,
     return ret;
 
   if (arg>=cargc) {
-    showfunclist(reply, source, chanOutputTree);
+    reply(sender,"No search terms - aborting.");
     return CMD_ERROR;
   }
 
@@ -426,7 +378,7 @@ int do_usersearch_real(replyFunc reply, wallFunc wall, void *source, int cargc,
     return ret;
 
   if (arg>=cargc) {
-    showfunclist(reply, source, userOutputTree);
+    reply(sender,"No search terms - aborting.");
     return CMD_ERROR;
   }
 
index 43c516b9a3357b175c68740484b57dbbc1cd681f..8bc393560225e8627b2ffd032ce6f54171ab5351 100644 (file)
@@ -164,9 +164,9 @@ void gline_free(searchCtx *ctx, struct searchNode *thenode) {
               if (!IsOper(np) && !IsService(np) && !IsXOper(np)) {
                 nssnprintf(msgbuf, sizeof(msgbuf), localdata->reason, np);
                 if (np->host->clonecount <= NSMAX_GLINE_CLONES)
-                  irc_send("%s GL * +*@%s %u %u :%s", mynumeric->content, IPtostr(np->p_ipaddr), localdata->duration +  time(NULL), time(NULL), localdata->duration);
+                  irc_send("%s GL * +*@%s %u :%s", mynumeric->content, IPtostr(np->p_ipaddr), localdata->duration, msgbuf);
                 else
-                  irc_send("%s GL * +%s@%s %u %u :%s", mynumeric->content, np->ident, IPtostr(np->p_ipaddr), localdata->duration + time(NULL), time(NULL), msgbuf);
+                  irc_send("%s GL * +%s@%s %u :%s", mynumeric->content, np->ident, IPtostr(np->p_ipaddr), localdata->duration, msgbuf);
               }
               else
                 safe++;