Explorar o código

* Remove netmsg, apparently people can't handle not abusing

Bryan Drewery %!s(int64=16) %!d(string=hai) anos
pai
achega
b85e29cf21
Modificáronse 3 ficheiros con 3 adicións e 48 borrados
  1. 0 1
      doc/UPDATES
  2. 2 7
      doc/help.txt
  3. 1 40
      src/cmds.c

+ 0 - 1
doc/UPDATES

@@ -113,7 +113,6 @@
   * Add cmd_hash which returns the MD5, SHA1 and SHA256 of the given string.
   * Credits/cmd_about updates.
   * Add chanset '+/-voicebitch' for a +bitch style enforcement over voices.
-  * Add cmd_netmsg back in. It may only be used to message channels the bots are opped in.
   * Add chanset '+/-protect' which will set +botbitch and mass deop if any takeover is detected.
   * Add chanset 'protect-backup' which will optionally set +backup in the event of a takeover with +protect.
   * Channel settings 'mop' and 'mdop' now react to non-users.

+ 2 - 7
doc/help.txt

@@ -285,7 +285,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: netmsg, msg%{+n}
+See also: msg%{+n}
 :hub:botnick:
 ###  $bbotnick$b <bot>
    The specified bot will display its current nick over DCC.
@@ -1372,7 +1372,7 @@ See also: whois
    Sends a private message to someone from the bot, just as if the
    bot had typed /msg.
  
-See also: netmsg, botmsg%{+n}
+See also: botmsg%{+n}
 :hub:netcrontab:
 ###  $bnetcrontab$b <status|delete|show|new> [interval]
    Runs the specified command on all linked bots.
@@ -1388,11 +1388,6 @@ See also: lagged
    the user that they are currently running as.
  
 See also: last
-:hub:netmsg:
-###  $bnetmsg$b <bot> <#chan> <text>
-   Sends a message to the specified channel from all opped bots.
- 
-See also: botmsg, msg%{+n}
 :hub:netnick:
 ###  $bnetnick$b 
    All bots on the botnet will display their nick over DCC.

+ 1 - 40
src/cmds.c

@@ -3963,7 +3963,7 @@ static void rcmd_curnick(char * fbot, char * fhand, char * fidx) {
   }
 }
 
-/* netmsg, botmsg */
+/* botmsg */
 static void cmd_botmsg(int idx, char * par) {
   char *tnick = NULL, *tbot = NULL;
 
@@ -3986,29 +3986,6 @@ static void cmd_botmsg(int idx, char * par) {
   botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, tmp);
 }
 
-static void cmd_netmsg(int idx, char * par) {
-  char *tnick = NULL;
-
-  putlog(LOG_CMDS, "*", "#%s# netmsg %s", dcc[idx].nick, par);
-  tnick = newsplit(&par);
-  if (!par[0]) {
-    dprintf(idx, "Usage: netmsg <#channel> <message>\n");
-    return;
-  }
-
-  if (!strchr(CHANMETA, tnick[0])) {
-    dprintf(idx, "You may only netmsg channels the bots are opped in.\n");
-    return;
-  }
-
-  dprintf(idx, "Abuse of this command may lead to G/D/Klines, shell slips and rage.\n");
-
-  char tmp[1024] = "";
-
-  simple_snprintf(tmp, sizeof tmp, "nmsg %s %s", tnick, par);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
-}
-
 static void rcmd_msg(char * tobot, char * frombot, char * fromhand, char * fromidx, char * par) {
   if (!conf.bot->hub) {
     char *nick = newsplit(&par);
@@ -4023,18 +4000,6 @@ static void rcmd_msg(char * tobot, char * frombot, char * fromhand, char * fromi
   }
 }
 
-static void rcmd_nmsg(char * tobot, char * frombot, char * fromhand, char * fromidx, char * par) {
-  if (!conf.bot->hub) {
-    char *par2 = strdup(par), *p2 = par2;
-    char *nick = newsplit(&par2);
-
-    if (!(!strchr(CHANMETA, nick[0]) || !me_op(findchan_by_dname(nick))))
-        rcmd_msg(tobot, frombot, fromhand, fromidx, par);
-    free(p2);
-  }
-}
-
-
 /* netlag */
 static void cmd_netlag(int idx, char * par) {
   egg_timeval_t tv;
@@ -4379,9 +4344,6 @@ void gotremotecmd (char *forbot, char *frombot, char *fromhand, char *fromidx, c
     rcmd_jump(frombot, fromhand, fromidx, par);
   } else if (!strcmp(cmd, "msg")) {
     rcmd_msg(forbot, frombot, fromhand, fromidx, par);
-  } else if (!strcmp(cmd, "nmsg")) {
-    if (!strchr(CHANMETA, par[0])) return;
-    rcmd_nmsg(forbot, frombot, fromhand, fromidx, par);
   } else if (!strcmp(cmd, "ver")) {
     rcmd_ver(frombot, fromhand, fromidx);
   } else if (!strcmp(cmd, "ping")) {
@@ -4669,7 +4631,6 @@ cmd_t C_dcc[] =
   {"whom",		"",	(Function) cmd_whom,		NULL, 0},
   {"whoami",		"",	(Function) cmd_whoami,		NULL, AUTH},
   {"botjump",           "m",    (Function) cmd_botjump,         NULL, HUB},
-  {"netmsg",		"a",    (Function) cmd_netmsg,          NULL, HUB},
   {"botmsg",		"o",    (Function) cmd_botmsg,          NULL, HUB},
   {"botnick", 		"m", 	(Function) cmd_botnick, 	NULL, HUB},
   {"netnick", 		"m", 	(Function) cmd_netnick, 	NULL, HUB},