[cvslog] [CVS] Module eggdrop1.6: Change committed

cvs at eggheads.org cvs at eggheads.org
Sat Jul 10 08:55:00 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-07-10 14:55:00 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     src/mod/channels.mod/channels.c src/mod/channels.mod/channels.h
     src/mod/channels.mod/cmdschan.c src/mod/channels.mod/tclchan.c

Log message:

Channels weren't read from the chanfile.

---------------------- diff included ----------------------
Index: eggdrop1.6/src/mod/channels.mod/channels.c
diff -u eggdrop1.6/src/mod/channels.mod/channels.c:1.106 eggdrop1.6/src/mod/channels.mod/channels.c:1.107
--- eggdrop1.6/src/mod/channels.mod/channels.c:1.106	Fri Jul  9 17:29:54 2010
+++ eggdrop1.6/src/mod/channels.mod/channels.c	Sat Jul 10 08:54:49 2010
@@ -2,7 +2,7 @@
  * channels.c -- part of channels.mod
  *   support for channels within the bot
  *
- * $Id: channels.c,v 1.106 2010/07/09 23:29:54 pseudo Exp $
+ * $Id: channels.c,v 1.107 2010/07/10 14:54:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -488,15 +488,16 @@
   movefile(s, chanfile);
 }
 
-static void read_channels(int create)
+static void read_channels(int create, int reload)
 {
   struct chanset_t *chan, *chan_next;
 
   if (!chanfile[0])
     return;
 
-  for (chan = chanset; chan; chan = chan->next)
-    chan->status |= CHAN_FLAGGED;
+  if (reload)
+    for (chan = chanset; chan; chan = chan->next)
+      chan->status |= CHAN_FLAGGED;
 
   chan_hack = 1;
   if (!readtclprog(chanfile) && create) {
@@ -512,6 +513,8 @@
       fclose(f);
   }
   chan_hack = 0;
+  if (!reload)
+    return;
   for (chan = chanset; chan; chan = chan_next) {
     chan_next = chan->next;
     if (chan->status & CHAN_FLAGGED) {
@@ -538,6 +541,8 @@
 
 static void channels_rehash()
 {
+  /* add channels from the chanfile but don't remove missing ones */
+  read_channels(1, 0);
   write_channels();
 }
 
@@ -1010,6 +1015,6 @@
   my_tcl_ints[0].val = &share_greet;
   add_tcl_ints(my_tcl_ints);
   add_tcl_coups(mychan_tcl_coups);
-  read_channels(0);
+  read_channels(0, 1);
   return NULL;
 }
Index: eggdrop1.6/src/mod/channels.mod/channels.h
diff -u eggdrop1.6/src/mod/channels.mod/channels.h:1.32 eggdrop1.6/src/mod/channels.mod/channels.h:1.33
--- eggdrop1.6/src/mod/channels.mod/channels.h:1.32	Thu Feb 18 03:52:29 2010
+++ eggdrop1.6/src/mod/channels.mod/channels.h	Sat Jul 10 08:54:49 2010
@@ -1,7 +1,7 @@
 /*
  * channels.h -- part of channels.mod
  *
- * $Id: channels.h,v 1.32 2010/02/18 09:52:29 pseudo Exp $
+ * $Id: channels.h,v 1.33 2010/07/10 14:54:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -99,7 +99,7 @@
 static int write_invites(FILE *f, int idx);
 static void check_expired_invites(void);
 static void write_channels(void);
-static void read_channels(int);
+static void read_channels(int, int);
 static void clear_channel(struct chanset_t *, int);
 static void get_mode_protect(struct chanset_t *chan, char *s);
 static void set_mode_protect(struct chanset_t *chan, char *set);
Index: eggdrop1.6/src/mod/channels.mod/cmdschan.c
diff -u eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.84 eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.85
--- eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.84	Thu Jul  1 10:10:49 2010
+++ eggdrop1.6/src/mod/channels.mod/cmdschan.c	Sat Jul 10 08:54:49 2010
@@ -2,7 +2,7 @@
  * cmdschan.c -- part of channels.mod
  *   commands from a user via dcc that cause server interaction
  *
- * $Id: cmdschan.c,v 1.84 2010/07/01 16:10:49 thommey Exp $
+ * $Id: cmdschan.c,v 1.85 2010/07/10 14:54:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1592,7 +1592,7 @@
   else {
     dprintf(idx, "Reloading all dynamic channel settings.\n");
     putlog(LOG_CMDS, "*", "#%s# chanload", dcc[idx].nick);
-    read_channels(1);
+    read_channels(1, 1);
   }
 }
 
Index: eggdrop1.6/src/mod/channels.mod/tclchan.c
diff -u eggdrop1.6/src/mod/channels.mod/tclchan.c:1.105 eggdrop1.6/src/mod/channels.mod/tclchan.c:1.106
--- eggdrop1.6/src/mod/channels.mod/tclchan.c:1.105	Wed Mar 24 07:14:50 2010
+++ eggdrop1.6/src/mod/channels.mod/tclchan.c	Sat Jul 10 08:54:49 2010
@@ -1,7 +1,7 @@
 /*
  * tclchan.c -- part of channels.mod
  *
- * $Id: tclchan.c,v 1.105 2010/03/24 13:14:50 pseudo Exp $
+ * $Id: tclchan.c,v 1.106 2010/07/10 14:54:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1628,7 +1628,7 @@
     Tcl_AppendResult(irp, "no channel file", NULL);
     return TCL_ERROR;
   }
-  read_channels(1);
+  read_channels(1, 1);
   return TCL_OK;
 }
 
----------------------- End of diff -----------------------


More information about the Changes mailing list