Ver código fonte

* Port [3655] to 1.2.15 from trunk
* Remove cmd_netmsg and restrict cmd_msg so it cannot be used from botcmd.



svn: 3656

Bryan Drewery 18 anos atrás
pai
commit
7559d4f10d
4 arquivos alterados com 10 adições e 8 exclusões
  1. 1 0
      doc/UPDATES
  2. 2 7
      misc/help.txt
  3. 2 1
      src/cmds.c
  4. 5 0
      src/mod/irc.mod/cmdsirc.c

+ 1 - 0
doc/UPDATES

@@ -1,6 +1,7 @@
 1.2.15 - http://wraith.botpack.net/milestone/1.2.15
 * Fix a possible segfault when binaries compiled wrong
 * Fix a segfault in op cookies during a desync
+* Remove cmd_netmsg and restrict cmd_msg so it cannot be used from botcmd.
 
 1.2.14 - http://wraith.botpack.net/milestone/1.2.14
 * Fix another bug in shell functions. (fixes #321)

+ 2 - 7
misc/help.txt

@@ -282,7 +282,7 @@ See also: jump, servers, botserver
    sends a private message to someone from the bot, just as if the
    bot had typed /msg.
  
-See also: msg%{+n}, netmsg%{-}
+See also: msg%{+n}
 ::botnick:
 ###  $bbotnick$b <bot>
    The bot will display it's current nick over DCC.
@@ -1302,7 +1302,7 @@ See also: whois
    Sends a private message to someone from the bot, just as if the
    bot had typed /msg.
  
-See also: botmsg%{+n}, netmsg%{-}
+See also: botmsg%{+n}
 :hub:netcrontab:
 ###  $bnetcrontab$b <status|delete|show|new> [interval]
    Runs the specified command on all linked bots.
@@ -1318,11 +1318,6 @@ See also: lagged
    the user that they are currently running as.
  
 See also: last
-::netmsg:
-###  $bnetmsg$b <nickname|#chan> <text>
-   All bots on the botnet will send a msg to the specified target.
- 
-See also: botmsg, msg
 ::netnick:
 ###  $bnetnick$b 
    All bots on the botnet will display their nick over DCC.

+ 2 - 1
src/cmds.c

@@ -3841,6 +3841,7 @@ static void cmd_botmsg(int idx, char * par) {
   botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, tmp);
 }
 
+#if 0
 static void cmd_netmsg(int idx, char * par) {
   char *tnick = NULL;
 
@@ -3856,6 +3857,7 @@ static void cmd_netmsg(int idx, char * par) {
   simple_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
 }
+#endif
 
 static void rcmd_msg(char * tobot, char * frombot, char * fromhand, char * fromidx, char * par) {
   if (!conf.bot->hub) {
@@ -4513,7 +4515,6 @@ cmd_t C_dcc[] =
   {"whoami",		"",	(Function) cmd_whoami,		NULL, AUTH},
   {"botjump",           "m",    (Function) cmd_botjump,         NULL, 0},
   {"botmsg",		"o",    (Function) cmd_botmsg,          NULL, 0},
-  {"netmsg", 		"n", 	(Function) cmd_netmsg, 		NULL, 0},
   {"botnick", 		"m", 	(Function) cmd_botnick, 	NULL, 0},
   {"netnick", 		"m", 	(Function) cmd_netnick, 	NULL, 0},
   {"netw", 		"n", 	(Function) cmd_netw, 		NULL, HUB},

+ 5 - 0
src/mod/irc.mod/cmdsirc.c

@@ -100,6 +100,11 @@ static void cmd_act(int idx, char *par)
 
 static void cmd_msg(int idx, char *par)
 {
+  if (dcc[idx].simul >= 0) {
+    dprintf(idx, "Sorry, that cmd isn't available over botcmd.\n");
+    return;
+  }
+
   if (!par[0]) {
     dprintf(idx, "Usage: msg <nick> <message>\n");
     return;