Przeglądaj źródła

* Fixed cmd_[ch]handle saving userfile when changes weren't actually made.

svn: 2146
Bryan Drewery 21 lat temu
rodzic
commit
25a46d51c2
2 zmienionych plików z 4 dodań i 3 usunięć
  1. 1 0
      doc/UPDATES
  2. 3 3
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -141,6 +141,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed *many* buffer overflows in the botnet code. (#94)
 * Fixed *many* buffer overflows in the botnet code. (#94)
 * Changes to console flag requirements: +rbh (PERM OWNER), +vd (+a), +egu (+n). (#99)
 * Changes to console flag requirements: +rbh (PERM OWNER), +vd (+a), +egu (+n). (#99)
 * cmd_botcmd blocks the following cmds for '*': die, restard, suicide, jump. (#17)
 * cmd_botcmd blocks the following cmds for '*': die, restard, suicide, jump. (#17)
+* Fixed cmd_[ch]handle saving userfile when changes weren't actually made.
 
 
 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.

+ 3 - 3
src/cmds.c

@@ -1250,9 +1250,9 @@ static void cmd_chhandle(int idx, char *par)
       putlog(LOG_CMDS, "*", "#%s# chhandle %s %s", dcc[idx].nick,
       putlog(LOG_CMDS, "*", "#%s# chhandle %s %s", dcc[idx].nick,
             hand, newhand);
             hand, newhand);
       dprintf(idx, "Changed.\n");
       dprintf(idx, "Changed.\n");
+      write_userfile(idx);
     } else
     } else
       dprintf(idx, "Failed.\n");
       dprintf(idx, "Failed.\n");
-    write_userfile(idx);
   }
   }
 }
 }
 
 
@@ -1285,10 +1285,10 @@ static void cmd_handle(int idx, char *par)
     if (change_handle(dcc[idx].user, newhandle)) {
     if (change_handle(dcc[idx].user, newhandle)) {
       putlog(LOG_CMDS, "*", "#%s# handle %s", oldhandle, newhandle);
       putlog(LOG_CMDS, "*", "#%s# handle %s", oldhandle, newhandle);
       dprintf(idx, "Okay, changed.\n");
       dprintf(idx, "Okay, changed.\n");
+      if (conf.bot->hub)
+        write_userfile(idx);
     } else
     } else
       dprintf(idx, "Failed.\n");
       dprintf(idx, "Failed.\n");
-    if (conf.bot->hub)
-      write_userfile(idx);
   }
   }
 }
 }