Browse Source

* Write out userfile in more places to trigger hub saving for localhubs

Bryan Drewery 14 years ago
parent
commit
77b4653081
3 changed files with 8 additions and 7 deletions
  1. 1 2
      src/debug.c
  2. 3 5
      src/misc.c
  3. 4 0
      src/mod/share.mod/share.c

+ 1 - 2
src/debug.c

@@ -212,8 +212,7 @@ static void got_term(int) __attribute__ ((noreturn));
 
 static void got_term(int z)
 {
-  if (conf.bot->hub)
-    write_userfile(-1);
+  write_userfile(-1);
   fatal("Received SIGTERM", 0);
   exit(1);		/* for GCC noreturn */
 }

+ 3 - 5
src/misc.c

@@ -609,9 +609,8 @@ int str_isdigit(const char *str)
  */
 void kill_bot(char *s1, char *s2)
 {
-  if (conf.bot->hub)
-    write_userfile(-1);
-  else
+  write_userfile(-1);
+  if (!conf.bot->hub)
     server_die();
   chatout("*** %s\n", s1);
   botnet_send_chat(-1, conf.bot->nick, s1);
@@ -818,8 +817,7 @@ restart(int idx)
 
   socks->my_close();
 
-  if (conf.bot->hub)
-    write_userfile(idx);
+  write_userfile(idx);
 /*
   if (server_online) {
     do_chanset(NULL, NULL, STR("+inactive"), DO_LOCAL);

+ 4 - 0
src/mod/share.mod/share.c

@@ -670,6 +670,10 @@ share_change(int idx, char *par)
       }
       noshare = 0;
     }
+
+    if (uet == &USERENTRY_BOTADDR) {
+      write_userfile(-1);
+    }
   }
 }