[eggheads-patches] PATCH: globchanset3.patch

Dobos Lorant drummer at sophia.jpte.hu
Sat Oct 23 17:25:35 CST 1999


diff -ur eggdrop1.3.1011/src/mod/channels.mod/tclchan.c eggdrop1.3/src/mod/channels.mod/tclchan.c
--- eggdrop1.3.1011/src/mod/channels.mod/tclchan.c	Mon Sep 27 01:14:24 1999
+++ eggdrop1.3/src/mod/channels.mod/tclchan.c	Thu Oct 21 21:43:05 1999
@@ -1099,15 +1122,25 @@
 	x++;
     }
   }
-  if (((oldstatus ^ chan->status) & CHAN_INACTIVE) && module_find("irc", 0, 0)) {
-    if (channel_inactive(chan) && (chan->status & (CHAN_ACTIVE + CHAN_PEND)))
-      dprintf(DP_SERVER, "PART %s\n", chan->name);
-    if (!channel_inactive(chan) && !(chan->status & (CHAN_ACTIVE + CHAN_PEND)))
-      dprintf(DP_SERVER, "JOIN %s %s\n", chan->name, chan->key_prot);
-  }
-  if ((oldstatus ^ chan->status) & (CHAN_ENFORCEBANS+CHAN_OPONJOIN+CHAN_BITCH+CHAN_AUTOVOICE))
-    if ((me = module_find("irc", 0, 0)))
-      (me->funcs[IRC_RECHECK_CHANNEL])(chan, 1);
+  /* if protect_readonly == 0 and chan_hack == 0 then
+     bot is now processing the configfile, so dont do anything,
+     we've to wait the channelfile that maybe override these settings
+     (note: it may cause problems if there is no chanfile!)
+     <drummer/1999/10/21>
+  */
+  if (protect_readonly || chan_hack) {
+    if (((oldstatus ^ chan->status) & CHAN_INACTIVE) &&
+        module_find("irc", 0, 0)) {
+      if (channel_inactive(chan) && (chan->status & (CHAN_ACTIVE | CHAN_PEND)))
+        dprintf(DP_SERVER, "PART %s\n", chan->name);
+      if (!channel_inactive(chan) && !(chan->status & (CHAN_ACTIVE | CHAN_PEND)))
+        dprintf(DP_SERVER, "JOIN %s %s\n", chan->name, chan->key_prot);
+    }
+    if ((oldstatus ^ chan->status) &
+        (CHAN_ENFORCEBANS | CHAN_OPONJOIN | CHAN_BITCH | CHAN_AUTOVOICE))
+      if ((me = module_find("irc", 0, 0)))
+        (me->funcs[IRC_RECHECK_CHANNEL])(chan, 1);
+  }
   if (x > 0) 
     return TCL_ERROR;
   return TCL_OK;
diff -ur eggdrop1.3.1011/src/mod/module.h eggdrop1.3/src/mod/module.h
--- eggdrop1.3.1011/src/mod/module.h	Fri Oct  8 01:12:02 1999
+++ eggdrop1.3/src/mod/module.h	Thu Oct 21 16:54:04 1999
@@ -322,6 +322,7 @@
 /* 232 - 235 */
 #define contextnote(note) (global[232](MODULE_NAME, __FILE__, __LINE__, note))
 #define assert_failed (global[233])
+#define protect_readonly (*(int *)(global[234]))
 
 #define ASSERT(expr) { if (!(expr)) assert_failed (MODULE_NAME, __FILE__, __LINE__); }
 
diff -ur eggdrop1.3.1011/src/modules.c eggdrop1.3/src/modules.c
--- eggdrop1.3.1011/src/modules.c	Sat Oct  9 19:33:47 1999
+++ eggdrop1.3/src/modules.c	Thu Oct 21 16:53:32 1999
@@ -66,6 +66,7 @@
 extern int do_restart;
 extern time_t now, online_since;
 extern struct chanset_t *chanset;
+extern int protect_readonly;
 int cmd_die(), xtra_kill(), xtra_unpack();
 static int module_rename(char *name, char *newname);
 
@@ -467,6 +468,7 @@
   /* 232 - 235 */
   (Function) mod_contextnote,
   (Function) assert_failed,
+  (Function) & protect_readonly, /* int */
 };
 
 void init_modules(void)





More information about the Patches mailing list