Răsfoiți Sursa

* Join/Part chans when [bot]set groups changes

Bryan Drewery 14 ani în urmă
părinte
comite
ad4e02dedf
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      src/set.c

+ 10 - 0
src/set.c

@@ -14,6 +14,7 @@
 #include "misc.h"
 #include "net.h"
 #include "src/mod/server.mod/server.h"
+#include "src/mod/irc.mod/irc.h"
 #include "src/mod/channels.mod/channels.h"
 #include "src/mod/ctcp.mod/ctcp.h"
 #include "users.h"
@@ -412,6 +413,15 @@ sdprintf("var (mem): %s -> %s", var->name, datain ? datain : "(NULL)");
     var_set_mem(servers, servers->ldata ? servers->ldata : servers->gdata ? servers->gdata : NULL);
   }
 
+  // Check if should part/join channels based on groups changing
+  if (!conf.bot->hub && !strcmp(var->name, "groups")) {
+    if (server_online && !restarting && !loading && !reset_chans) {
+      for (struct chanset_t* chan = chanset; chan; chan = chan->next) {
+        check_shouldjoin(chan);
+      }
+    }
+  }
+
   if (datap)
     free(datap);