Просмотр исходного кода

* When booting, boot all sessions matching the nick given for the bot given (#37)

svn: 2035
Bryan Drewery 21 лет назад
Родитель
Сommit
bbadd3fa3f
3 измененных файлов с 5 добавлено и 4 удалено
  1. 1 0
      doc/UPDATES
  2. 3 3
      src/botcmd.c
  3. 1 1
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -63,6 +63,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Reverted patch from 1.2 which disabled removing duplicate msgs in server queue. (Fixes most queue/excess flood bugs)
 * Users can no longer whois PERM OWNERS unless they are themselves one.
 * Fixed cmd_boot to allow users to boot users they can whois. (Users with lower flags)
+  Also, cmd_boot will now boot all sessions of a user on the bot specified. (#37)
 * Fixed a file descriptor leak in the 'last' checking.
 * Fixed bot's being tagged with op/login stats. (#22)
 * cmd_cycle now will only cycle the net if done on the hub. Doing it on a leaf cycles only that one bot.

+ 3 - 3
src/botcmd.c

@@ -800,8 +800,8 @@ static void bot_reject(int idx, char *par)
     /* Kick someone here! */
     int ok = 0;
 
-    for (i = 0; (i < dcc_total) && (!ok); i++) {
-      if (dcc[i].type && (!egg_strcasecmp(who, dcc[i].nick)) && (dcc[i].type->flags & DCT_CHAT)) {
+    for (i = 0; i < dcc_total; i++) {
+      if (dcc[i].type && !egg_strcasecmp(who, dcc[i].nick) && (dcc[i].type->flags & DCT_CHAT)) {
         u = get_user_by_handle(userlist, from);
         if (u) {
           if (!whois_access(u, dcc[idx].user)) {
@@ -809,8 +809,8 @@ static void bot_reject(int idx, char *par)
             return;
           }
           do_boot(i, from, par);
-          ok = 1;
           putlog(LOG_CMDS, "*", "#%s# boot %s (%s)", from, who, par[0] ? par : "No reason");
+          ok = 1;
         }
       }
     }

+ 1 - 1
src/cmds.c

@@ -1059,7 +1059,7 @@ static void cmd_boot(int idx, char *par)
     return;
   }
   for (i = 0; i < dcc_total; i++) {
-    if (dcc[i].type && !egg_strcasecmp(dcc[i].nick, who) && !ok && (dcc[i].type->flags & DCT_CANBOOT)) {
+    if (dcc[i].type && !egg_strcasecmp(dcc[i].nick, who) && (dcc[i].type->flags & DCT_CANBOOT)) {
       if (!whois_access(dcc[idx].user, dcc[i].user)) {
         dprintf(idx, "Sorry, you cannot boot %s.\n", dcc[i].nick);
         return;