Quellcode durchsuchen

* Added var 'autoaway': How long in seconds until an idle user is set away on dcc auto. (Def: 1800, 30min)

svn: 2165
Bryan Drewery vor 21 Jahren
Ursprung
Commit
1dd02d0547
5 geänderte Dateien mit 9 neuen und 7 gelöschten Zeilen
  1. 1 1
      doc/UPDATES
  2. 2 0
      misc/help.txt
  3. 3 4
      src/main.c
  4. 2 1
      src/set.c
  5. 1 1
      src/set.h

+ 1 - 1
doc/UPDATES

@@ -10,7 +10,6 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 - Change userentry system around to use strings ?
 - Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
 - Remove bot_hublog
-- Simple autoaway on dcc after 10 minutes, will be customizable in the future.
 - Added cmd_iop which will invite the specified nick to a chan and then auto-op them upon joining (does a userhost)
 - Added hijacked invite detection based on server invite notices.
 
@@ -150,6 +149,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Clearing chanset var now correctly uses defaults.
 * Fixed cmd_jump/cmd_botjump not parsing 'server:port' correctly.
 * Added var 'auth-obscure': Don't halt on dcc w/dccauth if the pass is wrong; halt at hash (right or wrong). (#100)
+* Added var 'autoaway': How long in seconds until an idle user is set away on dcc auto. (Def: 1800, 30min)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 2 - 0
misc/help.txt

@@ -1496,6 +1496,8 @@ See also: reload, backup
 [C]  $bauth-prefix$b     The prefix character used for msg cmds, ie: $u!$uop or $u.$uop
 [B]  $bauth-obscure$b    Will not halt in dcc pass is wrong and authing is enabled. 
                           Will always fail at auth hash though.
+[N]  $bdcc-autoaway$b    Time in seconds until a user is set auto-away on dcc.
+                          (0/- to disable)
   *  Msg cmd vars may be left blank to disable usage of cmd.
 [S]  $bmsgop$b           Defines the cmd for opping via msging the bot.
 [S]  $bmsgpass$b         Defines the cmd for setting a pass via msging the bot.

+ 3 - 4
src/main.c

@@ -498,14 +498,12 @@ static void core_secondly()
   }
 }
 
-/*
 static void check_autoaway()
 {
   for (int i = 0; i < dcc_total; i++)
-    if (dcc[i].type && dcc[i].type == &DCC_CHAT && !(dcc[i].u.chat->away) && ((now - dcc[i].timeval) >= 600))
+    if (dcc[i].type && dcc[i].type == &DCC_CHAT && !(dcc[i].u.chat->away) && ((now - dcc[i].timeval) >= autoaway))
       set_away(i, "Auto away after 10 minutes.");
 }
-*/
 
 static int washub = -1;
 
@@ -522,7 +520,8 @@ static void core_minutely()
     send_timesync(-1);
 
   check_bind_time(&nowtm);
-//  check_autoaway();
+  if (autoaway)
+    check_autoaway();
 /*     flushlogs(); */
 }
 

+ 2 - 1
src/set.c

@@ -19,7 +19,7 @@
 #include "rfc1459.h"
 
 int set_noshare = 0;
-
+int autoaway = 1800;
 bool auth_obscure = 0;
 char alias[1024] = "bc botcmd,bl botcmd ?";
 char auth_key[51] = "";
@@ -52,6 +52,7 @@ static variable_t vars[] = {
  {"auth-key",		auth_key,		sizeof(auth_key),		VAR_STRING|VAR_PERM, NULL, NULL},
  {"auth-prefix",	auth_prefix,		sizeof(auth_prefix),		VAR_STRING|VAR_NOLHUB|VAR_PERM, NULL, NULL},
  {"auth-obscure",	&auth_obscure,		0,				VAR_INT|VAR_BOOL, NULL, NULL},
+ {"dcc-autoaway",	&autoaway,		0,				VAR_INT|VAR_NOLOC, NULL, NULL},	
  {"bad-process",	&badprocess,		0,				VAR_INT|VAR_DETECTED, NULL, NULL},
  {"dccauth",		&dccauth,		0,				VAR_INT|VAR_BOOL, NULL, NULL},
  {"chanset",		glob_chanset,		sizeof(glob_chanset),		VAR_STRING|VAR_CHANSET|VAR_NOLHUB, NULL, NULL},

+ 1 - 1
src/set.h

@@ -54,7 +54,7 @@ typedef struct rate_b {
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[], process_list[];
 extern bool		dccauth, auth_obscure;
-extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare,
+extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, autoaway,
 			kill_threshold, lag_threshold, op_bots, badprocess, hijack, login, promisc, trace;
 extern rate_t		op_requests, close_threshold;