Explorar el Código

* Cosmetic fix in cmd_status
* Fixed some bugs with "bot" and "raw" bind tables


svn: 729

Bryan Drewery hace 22 años
padre
commit
447ed582a4
Se han modificado 5 ficheros con 26 adiciones y 5 borrados
  1. 1 0
      doc/UPDATES
  2. 4 3
      src/botcmd.c
  3. 8 1
      src/core_binds.c
  4. 3 0
      src/mod/channels.mod/channels.c
  5. 10 1
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -19,6 +19,7 @@ This is a summary of ChangeLog basically.
 16.Bad cmdline passwords now spoof an error.
 16.Bad cmdline passwords now spoof an error.
 17.A long-standing bug with updating channel lists has been fixed, MAY cause "max sendq" quits.
 17.A long-standing bug with updating channel lists has been fixed, MAY cause "max sendq" quits.
 18.Added -k <botnick> for cmdline (to kill botnick)
 18.Added -k <botnick> for cmdline (to kill botnick)
+19.Small cosmetic fix in cmd_status for closed channels (show "+i")
 
 
 1.0.15 (Non-Release Version)
 1.0.15 (Non-Release Version)
 1.cmd_randstring is now limited to 300.
 1.cmd_randstring is now limited to 300.

+ 4 - 3
src/botcmd.c

@@ -1025,10 +1025,11 @@ static void bot_zapf(int idx, char *par)
     opcode = newsplit(&par);
     opcode = newsplit(&par);
     check_bind_bot(from, opcode, par);
     check_bind_bot(from, opcode, par);
     return;
     return;
+  } else {
+    i = nextbot(to);
+    if (i >= 0)
+      botnet_send_zapf(i, from, to, par);
   }
   }
-  i = nextbot(to);
-  if (i >= 0)
-    botnet_send_zapf(i, from, to, par);
 }
 }
 
 
 /* Used to send a global msg from Tcl on one bot to every other bot
 /* Used to send a global msg from Tcl on one bot to every other bot

+ 8 - 1
src/core_binds.c

@@ -106,7 +106,14 @@ void check_bind_dcc(const char *cmd, int idx, const char *text)
 
 
 void check_bind_bot(const char *nick, const char *code, const char *param)
 void check_bind_bot(const char *nick, const char *code, const char *param)
 {
 {
-  check_bind(BT_bot, code, NULL, nick, code, param);
+  char *mynick = NULL, *myparam = NULL, *p1 = NULL, *p2 = NULL;
+
+  mynick = p1 = strdup(nick);
+  myparam = p2 = strdup(param);
+
+  check_bind(BT_bot, code, NULL, mynick, code, myparam);
+  free(p1);
+  free(p2);
 }
 }
 
 
 void check_bind_chon(char *hand, int idx)
 void check_bind_chon(char *hand, int idx)

+ 3 - 0
src/mod/channels.mod/channels.c

@@ -682,6 +682,9 @@ static void channels_report(int idx, int details)
       if (!s[0])
       if (!s[0])
 	strcpy(s, MISC_LURKING);
 	strcpy(s, MISC_LURKING);
       get_mode_protect(chan, s2);
       get_mode_protect(chan, s2);
+      if (channel_closed(chan))
+        strcat(s2, "i");
+
       if (shouldjoin(chan)) {
       if (shouldjoin(chan)) {
 	if (channel_active(chan)) {
 	if (channel_active(chan)) {
 	  /* If it's a !chan, we want to display it's unique name too <cybah> */
 	  /* If it's a !chan, we want to display it's unique name too <cybah> */

+ 10 - 1
src/mod/server.mod/servmsg.c

@@ -134,7 +134,16 @@ static int check_bind_msgc(char *cmd, char *nick, char *from, struct userrec *u,
  */
  */
 static int check_bind_raw(char *from, char *code, char *msg)
 static int check_bind_raw(char *from, char *code, char *msg)
 {
 {
-  return check_bind(BT_raw, code, NULL, from, msg);
+  char *p1 = NULL, *p2 = NULL, *myfrom = NULL, *mymsg = NULL;
+  int ret = 0;
+
+  myfrom = p1 = strdup(from);
+  mymsg = p2 = strdup(msg);
+
+  ret = check_bind(BT_raw, code, NULL, myfrom, mymsg);
+  free(p1);
+  free(p2);
+  return ret;
 }
 }