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

* Ported [2889] to 1.2.11
* Fixed removed bots not being automatically unlinked from botnet. (fixes #254)


svn: 2890

Bryan Drewery 20 лет назад
Родитель
Сommit
14aca57e35
2 измененных файлов с 12 добавлено и 3 удалено
  1. 1 0
      doc/UPDATES
  2. 11 3
      src/userrec.c

+ 1 - 0
doc/UPDATES

@@ -6,6 +6,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed typo in help for .set
 * Fixed typo in help for .set
 * Fixed a bug in cmd_chattr with |m users. (fixes #267)
 * Fixed a bug in cmd_chattr with |m users. (fixes #267)
 * Suicide now removes userfile backups, most pid files, and crontab entries. (Fixes #125)
 * Suicide now removes userfile backups, most pid files, and crontab entries. (Fixes #125)
+* Fixed removed bots not being automatically unlinked from botnet. (fixes #254)
 
 
 1.2.10 - http://tracker.shatow.net/milestone/1.2.10
 1.2.10 - http://tracker.shatow.net/milestone/1.2.10
 * Removed old references to '+/-manop' and '+/-nomop' for chaninfo in help file.
 * Removed old references to '+/-manop' and '+/-nomop' for chaninfo in help file.

+ 11 - 3
src/userrec.c

@@ -14,6 +14,7 @@
 #include "misc_file.h"
 #include "misc_file.h"
 #include "rfc1459.h"
 #include "rfc1459.h"
 #include "dcc.h"
 #include "dcc.h"
+#include "botnet.h"
 #include "src/mod/share.mod/share.h"
 #include "src/mod/share.mod/share.h"
 #include "src/mod/channels.mod/channels.h"
 #include "src/mod/channels.mod/channels.h"
 #include "main.h"
 #include "main.h"
@@ -641,11 +642,18 @@ int deluser(char *handle)
     shareout("k %s\n", handle);
     shareout("k %s\n", handle);
   for (fnd = 0; fnd < dcc_total; fnd++) {
   for (fnd = 0; fnd < dcc_total; fnd++) {
     if (dcc[fnd].type && dcc[fnd].user == u) {
     if (dcc[fnd].type && dcc[fnd].user == u) {
-      dprintf(fnd, "-+- POOF! -+-\n");
-      dprintf(fnd, "You are no longer a user on this botnet.\n");
-      do_boot(fnd, conf.bot->nick, "User removed.");
+      if (conf.bot->hub && u->bot) {
+        int i = nextbot(handle);
+        if (i != -1 && !egg_strcasecmp(dcc[i].nick, handle))
+          botunlink(-1, handle, "Bot removed.");
+      } else if (!u->bot) {
+        dprintf(fnd, "-+- POOF! -+-\n");
+        dprintf(fnd, "You are no longer a user on this botnet.\n");
+        do_boot(fnd, conf.bot->nick, "User removed.");
+      }
     }
     }
   }
   }
+
   clear_chanlist();
   clear_chanlist();
   freeuser(u);
   freeuser(u);
   lastuser = NULL;
   lastuser = NULL;