ソースを参照

* Code cleanups
* Renamed tcl_channel_* to channel_*
* Now to fix that pesky .chanset bug!


svn: 697

Bryan Drewery 22 年 前
コミット
32494ddfe0

+ 2 - 1
src/botnet.c

@@ -11,6 +11,7 @@
 
 
 #include "common.h"
 #include "common.h"
 #include "botnet.h"
 #include "botnet.h"
+#include "chanprog.h"
 #include "net.h"
 #include "net.h"
 #include "users.h"
 #include "users.h"
 #include "misc.h"
 #include "misc.h"
@@ -90,7 +91,7 @@ void check_should_backup()
 
 
   for (chan = chanset; chan; chan = chan->next) {
   for (chan = chanset; chan; chan = chan->next) {
     if (chan->channel.backup_time && (chan->channel.backup_time < now) && !channel_backup(chan)) {
     if (chan->channel.backup_time && (chan->channel.backup_time < now) && !channel_backup(chan)) {
-      do_chanset(chan, STR("+backup"), 1);
+      do_chanset(chan, STR("+backup"), DO_LOCAL | DO_NET);
       chan->channel.backup_time = 0;
       chan->channel.backup_time = 0;
     }
     }
   }
   }

+ 27 - 18
src/chanprog.c

@@ -11,6 +11,7 @@
 
 
 #include "common.h"
 #include "common.h"
 #include "chanprog.h"
 #include "chanprog.h"
+#include "src/mod/channels.mod/channels.h"
 #include "rfc1459.h"
 #include "rfc1459.h"
 #include "net.h"
 #include "net.h"
 #include "misc.h"
 #include "misc.h"
@@ -703,22 +704,18 @@ int shouldjoin(struct chanset_t *chan)
 }
 }
 
 
 /* do_chanset() set (options) on (chan)
 /* do_chanset() set (options) on (chan)
- * local: 0 - send out over botnet only
- * local: 1 - ALSO set locally
- * local: 2 - ONLY set locally
+ * USES DO_LOCAL|DO_NET bits.
  */
  */
 void do_chanset(struct chanset_t *chan, char *options, int local)
 void do_chanset(struct chanset_t *chan, char *options, int local)
 {
 {
-  char *buf = NULL;
-  module_entry *me = NULL;
 
 
-  /* send out over botnet. */
-  if (local != 2) {
+  if (local & DO_NET) {
+    char *buf = NULL;
          /* malloc(options,chan,'cset ',' ',+ 1) */
          /* malloc(options,chan,'cset ',' ',+ 1) */
     if (chan)
     if (chan)
-      buf = malloc(strlen(options) + strlen(chan->dname) + 5 + 1 + 1);
+      buf = calloc(1, strlen(options) + strlen(chan->dname) + 5 + 1 + 1);
     else
     else
-      buf = malloc(strlen(options) + 1 + 5 + 1 + 1);
+      buf = calloc(1, strlen(options) + 1 + 5 + 1 + 1);
 
 
     strcat(buf, "cset ");
     strcat(buf, "cset ");
     if (chan)
     if (chan)
@@ -733,11 +730,8 @@ void do_chanset(struct chanset_t *chan, char *options, int local)
     free(buf);
     free(buf);
   }
   }
 
 
-  /* now set locally, hopefully it works */
-  if (local && (me = module_find("channels", 0, 0))) {
-  /* tcl_channel_modify(0, chan, 1, options) */
-    Function *func = me->funcs;
-    char *buf2 = NULL, *bak = NULL;
+  if (local & DO_LOCAL) {
+    char *buf2 = NULL, *bak = NULL; 
     struct chanset_t *ch = NULL;
     struct chanset_t *ch = NULL;
     int all = 0;
     int all = 0;
 
 
@@ -748,9 +742,24 @@ void do_chanset(struct chanset_t *chan, char *options, int local)
       ch = chan;
       ch = chan;
 
 
     bak = options;
     bak = options;
-    buf2 = malloc(strlen(options) + 1);
+    buf2 = malloc(strlen(options) + 1); 
 
 
     while (ch) {
     while (ch) {
+/* expiremental code 
+      const char **list = NULL;
+      int items = 0;
+      char result[1024] = "";
+
+      if (SplitList(result, options, &items, &item) != OK) {
+        putlog(LOG_MISC, "*", "Error parsing channel options: %s", result);
+        return ERROR;
+
+      if ((channel_modify(result, chan, items, (char **) item) != OK) && !loading) {
+        ret = ERROR;
+      }
+
+  free(item);
+*/
       char *list[2] = { NULL, NULL };
       char *list[2] = { NULL, NULL };
 
 
       strcpy(buf2, bak);
       strcpy(buf2, bak);
@@ -758,13 +767,13 @@ void do_chanset(struct chanset_t *chan, char *options, int local)
       list[0] = newsplit(&options);
       list[0] = newsplit(&options);
       while (list[0][0]) {
       while (list[0][0]) {
         if (list[0][0] == '+' || list[0][0] == '-' || (!strcmp(list[0], "dont-idle-kick"))) {
         if (list[0][0] == '+' || list[0][0] == '-' || (!strcmp(list[0], "dont-idle-kick"))) {
-          (func[38]) (NULL, ch, 1, list);		/* tcl_channel_modify() */
+          channel_modify(NULL, ch, 1, list);
           list[0] = newsplit(&options);
           list[0] = newsplit(&options);
           continue;
           continue;
         }
         }
-	/* chanints */
+        /* chanints */
         list[1] = options;
         list[1] = options;
-        (func[38]) (NULL, ch, 2, list);			/* tcl_channel_modify() */
+        channel_modify(NULL, ch, 2, list);
         break;
         break;
       }
       }
       if (all)
       if (all)

+ 3 - 0
src/chanprog.h

@@ -1,6 +1,9 @@
 #ifndef _CHANPROG_H
 #ifndef _CHANPROG_H
 #define _CHANPROG_H
 #define _CHANPROG_H
 
 
+#define DO_LOCAL	1
+#define DO_NET		2
+
 #ifndef MAKING_MODS
 #ifndef MAKING_MODS
 extern struct chanset_t *chanset;
 extern struct chanset_t *chanset;
 extern char botname[];
 extern char botname[];

+ 8 - 7
src/mod/channels.mod/channels.c

@@ -9,6 +9,7 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include "src/mod/module.h"
 #include "src/mod/module.h"
 #include "src/mod/irc.mod/irc.h"
 #include "src/mod/irc.mod/irc.h"
+#include "src/chanprog.h"
 
 
 static Function *global = NULL, *irc_funcs = NULL;
 static Function *global = NULL, *irc_funcs = NULL;
 
 
@@ -92,7 +93,7 @@ static void check_should_lock()
   if ((hc >= H) && (lc <= L)) {
   if ((hc >= H) && (lc <= L)) {
     for (chan = chanset; chan; chan = chan->next) {
     for (chan = chanset; chan; chan = chan->next) {
       if (!channel_closed(chan)) {
       if (!channel_closed(chan)) {
-        do_chanset(chan, STR("+closed chanmode +stni"), 1);
+        do_chanset(chan, STR("+closed chanmode +stni"), DO_LOCAL | DO_NET);
 #ifdef G_BACKUP
 #ifdef G_BACKUP
         chan->channel.backup_time = now + 30;
         chan->channel.backup_time = now + 30;
 #endif /* G_BACKUP */
 #endif /* G_BACKUP */
@@ -131,7 +132,7 @@ static void got_cset(char *botnick, char *code, char *par)
 
 
   while (chan) {
   while (chan) {
     chname = chan->dname;
     chname = chan->dname;
-    do_chanset(chan, par, 2);
+    do_chanset(chan, par, DO_LOCAL);
     if (chan->status & CHAN_BITCH) {
     if (chan->status & CHAN_BITCH) {
       module_entry *me;
       module_entry *me;
       if ((me = module_find("irc", 0, 0)))
       if ((me = module_find("irc", 0, 0)))
@@ -174,7 +175,7 @@ static void got_cjoin(char *botnick, char *code, char *par)
    return;
    return;
   }
   }
 
 
-  if (tcl_channel_add(NULL, chname, par) == ERROR) /* drummer */
+  if (channel_add(NULL, chname, par) == ERROR) /* drummer */
     putlog(LOG_BOTS, "@", "Invalid channel or channel options from %s for %s", botnick, chname);
     putlog(LOG_BOTS, "@", "Invalid channel or channel options from %s for %s", botnick, chname);
   else {
   else {
 #ifdef HUB
 #ifdef HUB
@@ -199,7 +200,7 @@ static void got_cycle(char *botnick, char *code, char *par)
   if (par[0])
   if (par[0])
     delay = atoi(newsplit(&par));
     delay = atoi(newsplit(&par));
   
   
-  do_chanset(chan, "+inactive", 2);
+  do_chanset(chan, "+inactive", DO_LOCAL);
   dprintf(DP_SERVER, "PART %s\n", chan->name);
   dprintf(DP_SERVER, "PART %s\n", chan->name);
   chan->channel.jointime = ((now + delay) - server_lag); 		/* rejoin in 10 seconds */
   chan->channel.jointime = ((now + delay) - server_lag); 		/* rejoin in 10 seconds */
 }
 }
@@ -241,7 +242,7 @@ void got_kl(char *botnick, char *code, char *par)
     struct chanset_t *ch = NULL;
     struct chanset_t *ch = NULL;
 
 
     for (ch = chanset; ch; ch = ch->next)
     for (ch = chanset; ch; ch = ch->next)
-      do_chanset(ch, STR("+closed +backup +bitch"), 1);
+      do_chanset(ch, STR("+closed +backup +bitch"), DO_LOCAL | DO_NET);
   /* FIXME: we should randomize nick here ... */
   /* FIXME: we should randomize nick here ... */
   }
   }
 #endif /* S_AUTOLOCK */
 #endif /* S_AUTOLOCK */
@@ -849,8 +850,8 @@ static Function channels_table[] =
   (Function) u_delinvite,
   (Function) u_delinvite,
   /* 36 - 39 */
   /* 36 - 39 */
   (Function) u_addinvite,
   (Function) u_addinvite,
-  (Function) tcl_channel_add,
-  (Function) tcl_channel_modify,
+  (Function) channel_add,
+  (Function) channel_modify,
   (Function) write_exempts,
   (Function) write_exempts,
   /* 40 - 43 */
   /* 40 - 43 */
   (Function) write_invites,
   (Function) write_invites,

+ 8 - 4
src/mod/channels.mod/channels.h

@@ -80,8 +80,8 @@ static void get_mode_protect(struct chanset_t *chan, char *s);
 static void set_mode_protect(struct chanset_t *chan, char *set);
 static void set_mode_protect(struct chanset_t *chan, char *set);
 static int ismasked(masklist *m, char *user);
 static int ismasked(masklist *m, char *user);
 static int ismodeline(masklist *m, char *user);
 static int ismodeline(masklist *m, char *user);
-static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, char **item);
-static int tcl_channel_add(char *result, char *, char *);
+int channel_modify(char *result, struct chanset_t *chan, int items, char **item);
+static int channel_add(char *result, char *, char *);
 static int getudef(struct udef_chans *, char *);
 static int getudef(struct udef_chans *, char *);
 static void initudef(int type, char *, int);
 static void initudef(int type, char *, int);
 static void setudef(struct udef_struct *, char *, int);
 static void setudef(struct udef_struct *, char *, int);
@@ -134,8 +134,8 @@ inline static int chanset_unlink(struct chanset_t *chan);
 #define u_delinvite ((int (*)(struct chanset_t *, char *, int))channels_funcs[35])
 #define u_delinvite ((int (*)(struct chanset_t *, char *, int))channels_funcs[35])
 /* 36 - 39 */
 /* 36 - 39 */
 #define u_addinvite ((int (*)(struct chanset_t *, char *, char *, char *, time_t, int))channels_funcs[36])
 #define u_addinvite ((int (*)(struct chanset_t *, char *, char *, char *, time_t, int))channels_funcs[36])
-#define tcl_channel_add ((int (*)(char *, char *, char *))channels_funcs[37])
-#define tcl_channel_modify ((int (*)(char *, struct chanset_t *, int, char **))channels_funcs[38])
+#define channel_add ((int (*)(char *, char *, char *))channels_funcs[37])
+//#define channel_modify ((int (*)(char *, struct chanset_t *, int, char **))channels_funcs[38])
 #define write_exempts ((int (*)(FILE *, int))channels_funcs[39])
 #define write_exempts ((int (*)(FILE *, int))channels_funcs[39])
 /* 40 - 43 */
 /* 40 - 43 */
 #define write_invites ((int (*)(FILE *, int))channels_funcs[40])
 #define write_invites ((int (*)(FILE *, int))channels_funcs[40])
@@ -153,6 +153,10 @@ inline static int chanset_unlink(struct chanset_t *chan);
 #define write_config ((int (*)(FILE *, int))channels_funcs[50])
 #define write_config ((int (*)(FILE *, int))channels_funcs[50])
 #define check_should_lock ((void (*)(void))channels_funcs[51])
 #define check_should_lock ((void (*)(void))channels_funcs[51])
 
 
+
+int SplitList(char *, const char *, int *, const char ***);
+int channel_modify(char *, struct chanset_t *, int, char **);
+
 #endif				/* MAKING_CHANNELS */
 #endif				/* MAKING_CHANNELS */
 
 
 /* Macro's here because their functions were replaced by something more
 /* Macro's here because their functions were replaced by something more

+ 19 - 17
src/mod/channels.mod/cmdschan.c

@@ -961,7 +961,7 @@ static void cmd_slowjoin(struct userrec *u, int idx, char *par)
   strcpy(buf, "+inactive ");
   strcpy(buf, "+inactive ");
   if (par[0])
   if (par[0])
     strncat(buf, par, sizeof(buf));
     strncat(buf, par, sizeof(buf));
-  if (tcl_channel_add(NULL, chname, buf) == ERROR) {
+  if (channel_add(NULL, chname, buf) == ERROR) {
     dprintf(idx, "Invalid channel.\n");
     dprintf(idx, "Invalid channel.\n");
     return;
     return;
   }
   }
@@ -1353,7 +1353,7 @@ static void cmd_cycle(struct userrec *u, int idx, char *par)
   sprintf(buf2, "cycle %s %d", chname, delay); //this just makes the bot PART
   sprintf(buf2, "cycle %s %d", chname, delay); //this just makes the bot PART
   putallbots(buf2);
   putallbots(buf2);
 #ifdef LEAF
 #ifdef LEAF
-  do_chanset(chan, "+inactive", 2);
+  do_chanset(chan, "+inactive", DO_LOCAL);
   dprintf(DP_SERVER, "PART %s\n", chan->name);
   dprintf(DP_SERVER, "PART %s\n", chan->name);
   chan->channel.jointime = ((now + delay) - server_lag);
   chan->channel.jointime = ((now + delay) - server_lag);
 #endif /* LEAF */
 #endif /* LEAF */
@@ -1389,7 +1389,7 @@ static void cmd_down(struct userrec *u, int idx, char *par)
 
 
 static void cmd_pls_chan(struct userrec *u, int idx, char *par)
 static void cmd_pls_chan(struct userrec *u, int idx, char *par)
 {
 {
-  char *chname = NULL, buf2[1024] = "", buf[2048] = "";
+  char *chname = NULL, result[1024] = "", buf[2048] = "";
   struct chanset_t *chan = NULL;
   struct chanset_t *chan = NULL;
 
 
   putlog(LOG_CMDS, "*", "#%s# +chan %s", dcc[idx].nick, par);
   putlog(LOG_CMDS, "*", "#%s# +chan %s", dcc[idx].nick, par);
@@ -1400,14 +1400,14 @@ static void cmd_pls_chan(struct userrec *u, int idx, char *par)
   }
   }
 
 
   chname = newsplit(&par);
   chname = newsplit(&par);
-  sprintf(buf2, "cjoin %s %s", chname, par);
+  sprintf(buf, "cjoin %s %s", chname, par);
 
 
   if (findchan_by_dname(chname)) {
   if (findchan_by_dname(chname)) {
-    putallbots(buf2);
+    putallbots(buf);
     dprintf(idx, "That channel already exists!\n");
     dprintf(idx, "That channel already exists!\n");
     return;
     return;
   } else if ((chan = findchan(chname))) {
   } else if ((chan = findchan(chname))) {
-    putallbots(buf2);
+    putallbots(buf);
     /* This prevents someone adding a channel by it's unique server
     /* This prevents someone adding a channel by it's unique server
      * name <cybah>
      * name <cybah>
      */
      */
@@ -1415,22 +1415,24 @@ static void cmd_pls_chan(struct userrec *u, int idx, char *par)
     return;
     return;
   }
   }
 
 
-  if (tcl_channel_add(buf, chname, par) == ERROR) {/* drummer */
+  if (channel_add(result, chname, par) == ERROR) {
     dprintf(idx, "Invalid channel or channel options.\n");
     dprintf(idx, "Invalid channel or channel options.\n");
-    if (buf && buf[0])
-      dprintf(idx, "%s\n", buf);
+    if (result && result[0])
+      dprintf(idx, "%s\n", result);
   } else {
   } else {
     if ((chan = findchan_by_dname(chname))) {
     if ((chan = findchan_by_dname(chname))) {
       char *tmp = NULL;
       char *tmp = NULL;
 
 
-      putallbots(buf2);
-      tmp = malloc(7 + 1 + strlen(dcc[idx].nick) + 1);
+      putallbots(buf);
+
+      tmp = calloc(1, 7 + 1 + strlen(dcc[idx].nick) + 1);
       sprintf(tmp, "addedby %s", dcc[idx].nick);
       sprintf(tmp, "addedby %s", dcc[idx].nick);
-      do_chanset(chan, tmp, 1);
+      do_chanset(chan, tmp, DO_LOCAL | DO_NET );
       free(tmp);
       free(tmp);
+
       tmp = calloc(1, 7 + 1 + 10 + 1);
       tmp = calloc(1, 7 + 1 + 10 + 1);
       sprintf(tmp, "addedts %lu", now);
       sprintf(tmp, "addedts %lu", now);
-      do_chanset(chan, tmp, 1);
+      do_chanset(chan, tmp, DO_LOCAL | DO_NET );
       free(tmp);
       free(tmp);
     }
     }
 #ifdef HUB
 #ifdef HUB
@@ -1772,7 +1774,7 @@ static void cmd_chanset(struct userrec *u, int idx, char *par)
       while (list[0][0]) {
       while (list[0][0]) {
 	if (list[0][0] == '+' || list[0][0] == '-' ||
 	if (list[0][0] == '+' || list[0][0] == '-' ||
 	    (!strcmp(list[0], "dont-idle-kick"))) {
 	    (!strcmp(list[0], "dont-idle-kick"))) {
-	  if (tcl_channel_modify(0, chan, 1, list) == OK) {
+	  if (channel_modify(0, chan, 1, list) == OK) {
 	    strcat(answers, list[0]);
 	    strcat(answers, list[0]);
 	    strcat(answers, " ");
 	    strcat(answers, " ");
 	  } else if (!all || !chan->next)
 	  } else if (!all || !chan->next)
@@ -1791,7 +1793,7 @@ static void cmd_chanset(struct userrec *u, int idx, char *par)
   	 * circumstances, so save it now.
   	 * circumstances, so save it now.
 	 */
 	 */
         parcpy = strdup(par);
         parcpy = strdup(par);
-        if (tcl_channel_modify(0, chan, 2, list) == OK) {
+        if (channel_modify(0, chan, 2, list) == OK) {
 	  strcat(answers, list[0]);
 	  strcat(answers, list[0]);
 	  strcat(answers, " { ");
 	  strcat(answers, " { ");
 	  strcat(answers, parcpy);
 	  strcat(answers, parcpy);
@@ -1805,7 +1807,7 @@ static void cmd_chanset(struct userrec *u, int idx, char *par)
         struct chanset_t *my_chan = NULL;
         struct chanset_t *my_chan = NULL;
 
 
         if ((my_chan = findchan_by_dname(chname)))
         if ((my_chan = findchan_by_dname(chname)))
-          do_chanset(my_chan, bak, 0);
+          do_chanset(my_chan, bak, DO_NET);
 	dprintf(idx, "Successfully set modes { %s } on %s.\n", answers, chname);
 	dprintf(idx, "Successfully set modes { %s } on %s.\n", answers, chname);
 #ifdef HUB
 #ifdef HUB
         write_userfile(idx);
         write_userfile(idx);
@@ -1817,7 +1819,7 @@ static void cmd_chanset(struct userrec *u, int idx, char *par)
         chan = chan->next;
         chan = chan->next;
     }
     }
     if (all && answers[0]) {
     if (all && answers[0]) {
-      do_chanset(NULL, bak, 0);		/* NULL does all */
+      do_chanset(NULL, bak, DO_NET);		
       dprintf(idx, "Successfully set modes { %s } on all channels.\n", answers);
       dprintf(idx, "Successfully set modes { %s } on all channels.\n", answers);
 #ifdef HUB
 #ifdef HUB
         write_userfile(idx);
         write_userfile(idx);

+ 6 - 4
src/mod/channels.mod/tclchan.c

@@ -3,7 +3,9 @@
  *
  *
  */
  */
 
 
-int FindElement(char *resultBuf, const char *list, int listLength, const char **elementPtr, const char **nextPtr, int *sizePtr, int *bracePtr)
+static int FindElement(char *resultBuf, const char *list, int listLength, 
+                       const char **elementPtr, const char **nextPtr, 
+                       int *sizePtr, int *bracePtr)
 {
 {
     const char *p = list;
     const char *p = list;
     const char *elemStart = NULL;	/* Points to first byte of first element. */
     const char *elemStart = NULL;	/* Points to first byte of first element. */
@@ -281,7 +283,7 @@ int SplitList(char *resultBuf, const char *list, int *argcPtr, const char ***arg
 
 
 /* Parse options for a channel.
 /* Parse options for a channel.
  */
  */
-static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, char **item)
+int channel_modify(char *result, struct chanset_t *chan, int items, char **item)
 {
 {
   int i, x = 0, found;
   int i, x = 0, found;
 #ifdef LEAF
 #ifdef LEAF
@@ -728,7 +730,7 @@ static void clear_channel(struct chanset_t *chan, int reset)
 
 
 /* Create new channel and parse commands.
 /* Create new channel and parse commands.
  */
  */
-static int tcl_channel_add(char *result, char *newname, char *options)
+static int channel_add(char *result, char *newname, char *options)
 {
 {
   struct chanset_t *chan = NULL;
   struct chanset_t *chan = NULL;
   int items = 0;
   int items = 0;
@@ -816,7 +818,7 @@ static int tcl_channel_add(char *result, char *newname, char *options)
    * if a user goes back to an eggdrop that no-longer supports certain
    * if a user goes back to an eggdrop that no-longer supports certain
    * (channel) options.
    * (channel) options.
    */
    */
-  if ((tcl_channel_modify(result, chan, items, (char **) item) != OK) && !loading) {
+  if ((channel_modify(result, chan, items, (char **) item) != OK) && !loading) {
     ret = ERROR;
     ret = ERROR;
   }
   }
 
 

+ 1 - 1
src/mod/irc.mod/cmdsirc.c

@@ -704,7 +704,7 @@ ContextNote("!mdop!");
   }
   }
   if (bitch && !simul && chan) {
   if (bitch && !simul && chan) {
     chan->status |= CHAN_BITCH;
     chan->status |= CHAN_BITCH;
-    do_chanset(chan, STR("+bitch"), 1);
+    do_chanset(chan, STR("+bitch"), DO_LOCAL | DO_NET);
   }
   }
   free(targets);
   free(targets);
   free(chanbots);
   free(chanbots);

+ 2 - 1
src/mod/irc.mod/irc.c

@@ -10,6 +10,7 @@
 #include "src/mod/module.h"
 #include "src/mod/module.h"
 #include "irc.h"
 #include "irc.h"
 #include "src/misc.h"
 #include "src/misc.h"
+#include "src/chanprog.h"
 #include "src/auth.h"
 #include "src/auth.h"
 #include "src/salt.h"
 #include "src/salt.h"
 #include "src/mod/server.mod/server.h"
 #include "src/mod/server.mod/server.h"
@@ -1096,7 +1097,7 @@ void check_netfight()
       if ((chan->channel.fighting) && (chan->channel.fighting > limit)) {
       if ((chan->channel.fighting) && (chan->channel.fighting > limit)) {
         if (!channel_bitch(chan) || !channel_closed(chan)) {
         if (!channel_bitch(chan) || !channel_closed(chan)) {
           putlog(LOG_WARN, "*", STR("Auto-closed %s - channel fight\n"), chan->dname);
           putlog(LOG_WARN, "*", STR("Auto-closed %s - channel fight\n"), chan->dname);
-          do_chanset(chan, STR("+bitch +closed"), 1);
+          do_chanset(chan, STR("+bitch +closed"), DO_LOCAL | DO_NET);
           enforce_closed(chan);
           enforce_closed(chan);
           dprintf(DP_MODE, STR("TOPIC %s :Auto-closed - channel fight\n"), chan->name);
           dprintf(DP_MODE, STR("TOPIC %s :Auto-closed - channel fight\n"), chan->name);
         }
         }

+ 1 - 1
src/userrec.c

@@ -424,7 +424,7 @@ int write_userfile(int idx)
     free(new_userfile);
     free(new_userfile);
     return 2;
     return 2;
   }
   }
-//  putlog(LOG_MISC, "*", USERF_WRITING);
+  /*  putlog(LOG_MISC, "*", USERF_WRITING); */
   if (sort_users)
   if (sort_users)
     sort_userlist();
     sort_userlist();
   tt = now;
   tt = now;

+ 1 - 1
src/users.c

@@ -827,7 +827,7 @@ int readuserfile(char *file, struct userrec **ret)
              newsplit(&options);
              newsplit(&options);
              options[strlen(options) - 1] = 0;
              options[strlen(options) - 1] = 0;
 /* Above is a hack to remove { } */
 /* Above is a hack to remove { } */
-             if ((func[37]) (resultbuf, chan, options) != OK) {	/* tcl_channel_add() */
+             if ((func[37]) (resultbuf, chan, options) != OK) {	/* channel_add() */
 printf("BUF: %s\n", resultbuf);
 printf("BUF: %s\n", resultbuf);
                putlog(LOG_MISC, "*", "Channel parsing error in userfile on line %d", line);
                putlog(LOG_MISC, "*", "Channel parsing error in userfile on line %d", line);
                free(my_ptr);
                free(my_ptr);