svn: 1352
@@ -43,6 +43,7 @@ This is a summary of ChangeLog basically.
* cmd_swhois now shows matching username
* cmd_botcmd * is now limited to +n only
* cmd_chhandle did not check if the old handle existed!
+* Simple autoaway on dcc after 10 minutes, will be customizable in the future.
1.1.9
@@ -487,7 +487,7 @@ void set_away(int idx, char *s)
botnet_send_away(-1, conf.bot->nick, dcc[idx].sock, s, idx);
}
- dprintf(idx, "You are now away.\n");
+ dprintf(idx, "You are now away. (%s)\n", s);
check_bind_away(conf.bot->nick, idx, s);
@@ -487,6 +487,13 @@ 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))
+ set_away(i, "Auto away after 10 minutes.");
+}
+
static void core_minutely()
{
#ifdef HUB
@@ -496,6 +503,7 @@ static void core_minutely()
check_mypid();
#endif
check_bind_time(&nowtm);
+ check_autoaway();
/* flushlogs(); */