Преглед на файлове

* Autoaway after 10 minutes

svn: 1352
Bryan Drewery преди 21 години
родител
ревизия
0fea40eedb
променени са 3 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/dccutil.c
  3. 8 0
      src/main.c

+ 1 - 0
doc/UPDATES

@@ -43,6 +43,7 @@ This is a summary of ChangeLog basically.
 * cmd_swhois now shows matching username
 * cmd_swhois now shows matching username
 * cmd_botcmd * is now limited to +n only
 * cmd_botcmd * is now limited to +n only
 * cmd_chhandle did not check if the old handle existed!
 * 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
 1.1.9
 
 

+ 1 - 1
src/dccutil.c

@@ -487,7 +487,7 @@ void set_away(int idx, char *s)
       botnet_send_away(-1, conf.bot->nick, dcc[idx].sock, s, idx);
       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);
   check_bind_away(conf.bot->nick, idx, s);
 }
 }
 
 

+ 8 - 0
src/main.c

@@ -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()
 static void core_minutely()
 {
 {
 #ifdef HUB
 #ifdef HUB
@@ -496,6 +503,7 @@ static void core_minutely()
   check_mypid();
   check_mypid();
 #endif
 #endif
   check_bind_time(&nowtm);
   check_bind_time(&nowtm);
+  check_autoaway();
 /*     flushlogs(); */
 /*     flushlogs(); */
 }
 }