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

* cmd_conf (delbot) now also removes the bot from the userfile
* cmd_mns_user cosmetic change


svn: 1767

Bryan Drewery 21 лет назад
Родитель
Сommit
7726c159de
2 измененных файлов с 19 добавлено и 2 удалено
  1. 2 0
      doc/UPDATES
  2. 17 2
      src/cmds.c

+ 2 - 0
doc/UPDATES

@@ -7,6 +7,8 @@ Lines prefixxed with '-' were disabled before release and are not finishsed.
 * Fixed binary getting an excess of 1-15 bytes during write. 
 * Fixed binary getting an excess of 1-15 bytes during write. 
 * Binary writing is now a bit faster as the hash is calculated on the fly now.
 * Binary writing is now a bit faster as the hash is calculated on the fly now.
 * If a binary is already initialized when updating, the pack data will not be overwritten.
 * If a binary is already initialized when updating, the pack data will not be overwritten.
+* cmd_conf (delbot) now also removes the bot from the userfile
+* cmd_mns_user cosmetic change
 
 
 1.2.2
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 17 - 2
src/cmds.c

@@ -1777,8 +1777,23 @@ static void cmd_conf(int idx, char *par)
       dprintf(idx, "Usage: conf del <bot>\n");
       dprintf(idx, "Usage: conf del <bot>\n");
       return;
       return;
     }
     }
+
     if (!conf_delbot(par)) {
     if (!conf_delbot(par)) {
-      dprintf(idx, "Deleted bot: %s\n", par);
+      struct userrec *u = NULL;
+
+      dprintf(idx, "Deleted bot from conf: %s\n", par);
+      if ((u = get_user_by_handle(par))) {
+#ifdef LEAF
+        check_this_user(par, 1, NULL);
+#endif /* LEAF */
+        if (deluser(par)) {
+          dprintf(idx, "Removed bot: %s.\n", par);
+#ifdef HUB
+          write_userfile(idx);
+#endif /* HUB */
+        }
+      }
+
       save++;
       save++;
     } else
     } else
       dprintf(idx, "Error trying to remove bot '%s'\n", par);
       dprintf(idx, "Error trying to remove bot '%s'\n", par);
@@ -3401,7 +3416,7 @@ static void cmd_mns_user(int idx, char *par)
   check_this_user(handle, 1, NULL);
   check_this_user(handle, 1, NULL);
 #endif /* LEAF */
 #endif /* LEAF */
   if (deluser(handle)) {
   if (deluser(handle)) {
-    dprintf(idx, "Deleted %s.\n", handle);
+    dprintf(idx, "Removed %s: %s.\n", u2->bot ? "bot" : "user", handle);
 #ifdef HUB
 #ifdef HUB
     write_userfile(idx);
     write_userfile(idx);
 #endif /* HUB */
 #endif /* HUB */