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

Merge branch 'newhub' into next

* newhub:
  * Write userfile after receiving it
  * Don't write out hubs if not a localhub/hub
  * Write userfile when adding/removing users/bots
Bryan Drewery 14 лет назад
Родитель
Сommit
602c828a3c
2 измененных файлов с 8 добавлено и 0 удалено
  1. 4 0
      src/conf.c
  2. 4 0
      src/mod/share.mod/share.c

+ 4 - 0
src/conf.c

@@ -1024,6 +1024,10 @@ bin_to_conf(bool error)
 }
 
 void conf_update_hubs(struct userrec* list) {
+  if (!conf.bot->hub && !conf.bot->localhub) {
+    return;
+  }
+
   bd::Array<bd::String> hubUsers, oldhubs(conf.hubs);
 
   // Count how many hubs there are

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

@@ -533,6 +533,7 @@ share_newuser(int idx, char *par)
       noshare = 0;
       if (conf.bot->hub)
         putlog(LOG_CMDS, "@", "%s: newuser %s %s", dcc[idx].nick, nick, s);
+      write_userfile(-1);
     }
   }
 }
@@ -551,6 +552,7 @@ share_killuser(int idx, char *par)
       shareout_but(idx, "k %s\n", par);
       if (conf.bot->hub)
         putlog(LOG_CMDS, "@", "%s: killuser %s", dcc[idx].nick, par);
+      write_userfile(-1);
     }
     noshare = 0;
   }
@@ -1450,6 +1452,8 @@ static void share_read_stream(int idx, bd::Stream& stream) {
     Auth::FillUsers();
   }
 
+  write_userfile(-1);
+
   cmdpass_free(old_cmdpass);
 
   checkchans(1);                /* remove marked channels */