Răsfoiți Sursa

* Disable irc.mod while restarting

Bryan Drewery 16 ani în urmă
părinte
comite
e2b8f9a7e2
2 a modificat fișierele cu 9 adăugiri și 1 ștergeri
  1. 6 1
      src/main.c
  2. 3 0
      src/mod/share.mod/share.c

+ 6 - 1
src/main.c

@@ -814,7 +814,6 @@ int main(int argc, char **argv)
   channels_init();
   if (!conf.bot->hub) {
     server_init();
-    irc_init();
     ctcp_init();
   }
   transfer_init();
@@ -888,6 +887,12 @@ int main(int argc, char **argv)
   if (socksfile)
     readsocks(socksfile);
 
+  if (!conf.bot->hub) {
+    // Restarting in new method - don't enable irc.mod until after receiving userfile.
+    if (reset_chans != 2)
+      irc_init();
+  }
+
   debug0(STR("main: entering loop"));
 
   int socket_cleanup = 0, xx, i = 0, idx = 0;

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

@@ -54,6 +54,8 @@
 #include "src/mod/irc.mod/irc.h"
 #include "src/mod/server.mod/server.h"
 
+void irc_init();
+
 static struct flag_record fr = { 0, 0, 0, 0 };
 
 static bd::Stream* stream_in;
@@ -1453,6 +1455,7 @@ static void share_read_stream(int idx, bd::Stream& stream) {
   /* If this is ever changed, do mind the restarting bool as it will prevent 001 from dumping JOINs.. */
   if (reset_chans) {
     if (reset_chans == 2) {
+      irc_init();
       putlog(LOG_DEBUG, "*", "Resetting channel info for all channels...");
       for (chan = chanset; chan; chan = chan->next) {
         if (shouldjoin(chan) && channel_pending(chan)) { // Set when reading socksfile