Przeglądaj źródła

Add set 'fish-auto-keyx' (#23)

Bryan Drewery 14 lat temu
rodzic
commit
a0260b3328
5 zmienionych plików z 9 dodań i 3 usunięć
  1. 1 1
      doc/UPDATES
  2. 2 0
      doc/help.txt
  3. 3 1
      src/mod/server.mod/servmsg.c
  4. 2 0
      src/set.c
  5. 1 1
      src/set.h

+ 1 - 1
doc/UPDATES

@@ -11,7 +11,7 @@
   * Suicide will now remove all bots related to the binary being removed (fixes #435)
   * FiSH message support added.
   * FiSH support for DH1080 key-exchange. 'keyx' command added to start from bot, and responds to key-exchanges.
-  * Auto FiSH key-exchange when accepting users via callerid
+  * Auto FiSH key-exchange when accepting users via callerid (controllable with set 'fish-auto-keyx')
   * When 'mdop' protection is on, re-op all previously opped clients automatically.
   * When 'mop' protection is on, deop all previously regular clients automatically.
   * Add './wraith -V' which will display the packconfig that the bot is using.

+ 2 - 0
doc/help.txt

@@ -1684,6 +1684,8 @@ See also: reload, backup
 [B]  $bcallerid$b        Run bot in CALLERID mode. This is commonly known as +g on most
                            servers. +c bots will automatically accept messages from
                            known users. Note that this will break msg-ident.
+[B]  $bfish-auto-keyx$b  Whether to automatically do a DH1010 FiSH Key exchange when
+                           accepting users. This is only supported if using callerid.
  
 [S]  $baltchars$b        Define string of characters to cycle when generating alternative
                           nicks when nick is taken. Ie: _-`[].

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

@@ -1915,7 +1915,9 @@ static int got718(char *from, char *msg)
         putlog(LOG_WALL, "*", "(CALLERID) !%s! (%s!%s) %s (Accepting user)", u->handle, nick, uhost, msg);
         dprintf(DP_HELP, "ACCEPT %s\n", nick);
         dprintf(DP_HELP, "PRIVMSG %s :You have been accepted. Please send your message again.\n", nick);
-        keyx(nick);
+        if (fish_auto_keyx) {
+          keyx(nick);
+        }
       } else {
         putlog(LOG_WALL, "*", "(CALLERID) !%s! (%s!%s) %s (User is not +o or +v)", u->handle, nick, uhost, msg);
       }

+ 2 - 0
src/set.c

@@ -74,6 +74,7 @@ int trace;
 bool manop_warn;
 char homechan[51] = "";
 char usermode[15] = "";
+bool fish_auto_keyx = 0;
 
 ////// THIS MUST REMAIN SORTED: !LC_ALL=C sort
 // VAR("bad-process",	&badprocess,		VAR_INT|VAR_DETECTED,				0, 4, "ignore"),
@@ -92,6 +93,7 @@ static variable_t vars[] = {
  VAR("dccauth",		&dccauth,		VAR_INT|VAR_BOOL,				0, 1, "0"),
  VAR("deaf",		&use_deaf,		VAR_INT|VAR_BOOL|VAR_NOLHUB,			0, 1, "1"),
  VAR("fight-threshold",	&fight_threshold,	VAR_INT|VAR_NOLOC,				0, 0, "0"),
+ VAR("fish-auto-keyx",	&fish_auto_keyx,	VAR_INT|VAR_BOOL|VAR_NOLHUB,			0, 1, "1"),
  VAR("flood-callerid",	&flood_callerid,	VAR_RATE|VAR_NOLHUB,				0, 0, "6:2"),
  VAR("flood-ctcp",	&flood_ctcp,		VAR_RATE|VAR_NOLHUB,				0, 0, "3:60"),
  VAR("flood-msg",	&flood_msg,		VAR_RATE|VAR_NOLHUB,				0, 0, "5:60"),

+ 1 - 1
src/set.h

@@ -70,7 +70,7 @@ typedef struct rate_b {
 extern char		auth_key[], auth_prefix[2], motd[], alias[], rbl_servers[1024], groups[1024],
 			msgident[], msginvite[], msgop[], msgpass[], msgrelease[],
                         homechan[], altchars[];
-extern bool		dccauth, auth_obscure, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway, link_cleartext, use_deaf, use_callerid;
+extern bool		dccauth, auth_obscure, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway, link_cleartext, use_deaf, use_callerid, fish_auto_keyx;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 			kill_threshold, lag_threshold, op_bots, hijack, login, promisc, trace,
                         ison_time, msgrate, msgburst;