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

cvs at eggheads.org cvs at eggheads.org
Wed Mar 24 07:15:01 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-03-24 13:15:00 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     eggdrop.conf doc/Changes1.6 doc/settings/mod.channels src/patch.h
     src/mod/channels.mod/channels.c src/mod/channels.mod/cmdschan.c
     src/mod/channels.mod/tclchan.c
     src/mod/channels.mod/help/chaninfo.help

Log message:

Channels added in the config are no longer static. Added access to the static flag via new channel setting, available to permanent owners only.
Removed the example channel adds from eggdrop.conf.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.78 eggdrop1.6/doc/Changes1.6:1.79
--- eggdrop1.6/doc/Changes1.6:1.78	Tue Mar 23 09:25:29 2010
+++ eggdrop1.6/doc/Changes1.6	Wed Mar 24 07:14:50 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.78 2010/03/23 15:25:29 pseudo Exp $
+$Id: Changes1.6,v 1.79 2010/03/24 13:14:50 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,11 @@
 
 1.6.20 (CVS):
 
+  - Channels added in the config are no longer static. Added access to the
+    static flag via new channel setting, available to permanent owners only.
+  - Removed the example channel adds from eggdrop.conf.
+    Patch by: pseudo
+
   - Changed some eggdrop.conf settings. .set and .tcl are no longer unbound
     by default.
   - Made .+chan check if the user is permitted to set the need-* settings.
Index: eggdrop1.6/doc/settings/mod.channels
diff -u eggdrop1.6/doc/settings/mod.channels:1.25 eggdrop1.6/doc/settings/mod.channels:1.26
--- eggdrop1.6/doc/settings/mod.channels:1.25	Sun Jan  3 07:27:23 2010
+++ eggdrop1.6/doc/settings/mod.channels	Wed Mar 24 07:14:50 2010
@@ -1,4 +1,4 @@
-$Id: mod.channels,v 1.25 2010/01/03 13:27:23 pseudo Exp $
+$Id: mod.channels,v 1.26 2010/03/24 13:14:50 pseudo Exp $
 
 Channels Module
 Last revised: February 12, 2003
@@ -155,7 +155,7 @@
          shorter than 120 characters. If you use scripts like getops.tcl or
          botnetop.tcl, you don't need to set this setting.
 
-       flood-chan 10:60
+       flood-chan 15:60
          Set here how many channel messages in how many seconds from one
          host constitutes a flood. Setting this to 0 or 0:0 disables text
          flood protection for the channel.
@@ -299,11 +299,13 @@
           fighting with services such as ChanServ, or from kicking IRCops when
           setting channel modes without having ops.
 
+        static
+          Allow only permanent owners to remove the channel?
 
     The following settings are used as default values when you .+chan #chan or .tcl
     channel add #chan. Look in the section above for explanation of every option.
 
-    set global-flood-chan 10:60
+    set global-flood-chan 15:60
     set global-flood-deop 3:10
     set global-flood-kick 3:10
     set global-flood-join 5:60
@@ -327,10 +329,10 @@
           -protectfriends +protectops
           -revenge        -revengebot
           -secret         -seen
-          +shared         +statuslog
+          +shared         -statuslog
           +userbans       +userexempts
           +userinvites    +protecthalfops
-          +autohalfop
+          +autohalfop     -static
     }
 
     _____________________________________________________________________
Index: eggdrop1.6/eggdrop.conf
diff -u eggdrop1.6/eggdrop.conf:1.63 eggdrop1.6/eggdrop.conf:1.64
--- eggdrop1.6/eggdrop.conf:1.63	Tue Mar 23 09:25:29 2010
+++ eggdrop1.6/eggdrop.conf	Wed Mar 24 07:14:50 2010
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- This should contain a fully qualified path to your Eggdrop executable.
 #
-# $Id: eggdrop.conf,v 1.63 2010/03/23 15:25:29 pseudo Exp $
+# $Id: eggdrop.conf,v 1.64 2010/03/24 13:14:50 pseudo Exp $
 #
 # This is a sample Eggdrop configuration file which includes all possible
 # settings that can be used to configure your bot.
@@ -492,7 +492,7 @@
 set allow-ps 0
 
 # The following settings are used as default values when you .+chan #chan or .tcl
-# channel add #chan. Look in the section below for explanation of every option.
+# channel add #chan. Look below for explanation of every option.
 
 set global-flood-chan 15:60
 set global-flood-deop 3:10
@@ -523,35 +523,9 @@
         +shared         -statuslog
         +userbans       +userexempts
         +userinvites    -protecthalfops
-        -autohalfop
+        -autohalfop     -static
 }
 
-# Add each static channel you want your bot to sit in using the following
-# command. There are many different possible settings you can insert into
-# this command, which are explained below.
-#
-#    channel add #lamest {
-#      chanmode "+nt-likm"
-#      idle-kick 0
-#      stopnethack-mode 0
-#      revenge-mode 0
-#      ban-time 120
-#      exempt-time 60
-#      invite-time 60
-#      aop-delay 5:30
-#      need-op { putserv "PRIVMSG #lamest :op me cos i'm lame!" }
-#      need-invite { putserv "PRIVMSG #lamest :let me in!" }
-#      need-key { putserv "PRIVMSG #lamest :let me in!" }
-#      need-unban { putserv "PRIVMSG #lamest :let me in!" }
-#      need-limit { putserv "PRIVMSG #lamest :let me in!" }
-#      flood-chan 10:60
-#      flood-deop 3:10
-#      flood-kick 3:10
-#      flood-join 5:60
-#      flood-ctcp 3:60
-#      flood-nick 5:60
-#    }
-#
 # chanmode +/-<modes>
 #    This setting makes the bot enforce channel modes. It will always add
 #    the +<modes> and remove the -<modes> modes.
@@ -659,7 +633,7 @@
 #    shorter than 120 characters. If you use scripts like getops.tcl or
 #    botnetop.tcl, you don't need to set this setting
 #
-# flood-chan 10:60
+# flood-chan 15:60
 #    Set here how many channel messages in how many seconds from one
 #    host constitutes a flood. Setting this to 0 or 0:0 disables
 #    flood protection for the channel.
@@ -689,16 +663,6 @@
 #    constitutes a flood. Setting this to 0 or 0:0 disables nick flood
 #    protection for the channel.
 #
-# There are many different options for channels which you can
-# define. They can be enabled or disabled using the channel set command by a
-# plus or minus in front of them.
-#
-#   channel set #lamest +enforcebans +dynamicbans +userbans +dynamicexempts
-#   channel set #lamest +userexempts +dynamicinvites +userinvites +protectops
-#   channel set #lamest +protectfriends +statuslog +revenge -protecthalfops
-#   channel set #lamest +revengebot +dontkickops +autovoice -autoop -autohalfop
-#   channel set #lamest -bitch -secret -shared +greet +cycle
-#
 # A complete list of all available channel settings:
 #
 # enforcebans
@@ -810,13 +774,15 @@
 #    fighting with services such as ChanServ, or from kicking IRCops when
 #    setting channel modes without having ops.
 #
-# Here is a shorter example:
-#
-#   channel add #botcentral {
-#     chanmode "+mntisl 1"
-#     idle-kick 1
-#   }
-#   channel set #botcentral +bitch +enforcebans -greet +revenge
+# static
+#    Allow only permanent owners to remove the channel?
+
+# To add a channel to eggdrop, please enter the bot's partyline and type
+# .+chan #channel. Check also .help chanset and .help chaninfo.
+# You can still add a channel here and it will be saved if you have a
+# chanfile. We recommend you to use the partyline though.
+# 
+#channel add #lamest
 
 
 #### SERVER MODULE ####
Index: eggdrop1.6/src/mod/channels.mod/channels.c
diff -u eggdrop1.6/src/mod/channels.mod/channels.c:1.104 eggdrop1.6/src/mod/channels.mod/channels.c:1.105
--- eggdrop1.6/src/mod/channels.mod/channels.c:1.104	Thu Feb 18 03:52:29 2010
+++ eggdrop1.6/src/mod/channels.mod/channels.c	Wed Mar 24 07:14:50 2010
@@ -2,7 +2,7 @@
  * channels.c -- part of channels.mod
  *   support for channels within the bot
  *
- * $Id: channels.c,v 1.104 2010/02/18 09:52:29 pseudo Exp $
+ * $Id: channels.c,v 1.105 2010/03/24 13:14:50 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -36,7 +36,7 @@
 
 static struct udef_struct *udef;
 
-static int setstatic, use_info, chan_hack, quiet_save, global_revenge_mode,
+static int use_info, chan_hack, quiet_save, global_revenge_mode,
            global_stopnethack_mode, global_idle_kick, global_aop_min,
            global_aop_max, global_ban_time, global_exempt_time,
            global_invite_time, global_ban_type, allow_ps;
@@ -543,14 +543,12 @@
     if (chan->status & CHAN_STATIC)
       chan->status &= ~CHAN_STATIC;
   }
-  setstatic = 1;
 }
 
 static void channels_rehash()
 {
   struct chanset_t *chan;
 
-  setstatic = 0;
   read_channels(1);
   /* Remove any extra channels, by checking the flag. */
   chan = chanset;
@@ -969,7 +967,6 @@
   global_aop_min = 5;
   global_aop_max = 30;
   allow_ps = 0;
-  setstatic = 0;
   lastdeletedmask = 0;
   use_info = 1;
   strcpy(chanfile, "chanfile");
@@ -1034,6 +1031,5 @@
   add_tcl_ints(my_tcl_ints);
   add_tcl_coups(mychan_tcl_coups);
   read_channels(0);
-  setstatic = 1;
   return NULL;
 }
Index: eggdrop1.6/src/mod/channels.mod/cmdschan.c
diff -u eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.82 eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.83
--- eggdrop1.6/src/mod/channels.mod/cmdschan.c:1.82	Tue Mar 23 09:25:29 2010
+++ eggdrop1.6/src/mod/channels.mod/cmdschan.c	Wed Mar 24 07:14:50 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.82 2010/03/23 15:25:29 pseudo Exp $
+ * $Id: cmdschan.c,v 1.83 2010/03/24 13:14:50 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1203,15 +1203,16 @@
     return;
   }
   for (i = 0; i < argc; i++) {
-    if (argv[i][0] == '-' || argv[i][0] == '+')
-      continue;
-    if (!strncmp(argv[i], "need-", 5) && (!(u->flags & USER_OWNER) ||
-        (!isowner(dcc[idx].nick) && must_be_owner))) {
-      dprintf(idx, "Due to security concerns, only permanent owners can set "
-                   "the need-* modes.\n");
+    if ((!strncmp(argv[i], "need-", 5) || !strcmp(argv[i] + 1, "static"))
+        && (!(u->flags & USER_OWNER) || (!isowner(dcc[idx].nick)
+        && must_be_owner))) {
+      dprintf(idx, "Due to security concerns, only permanent owners can "
+                   "set the need-* and +/-static modes.\n");
       Tcl_Free((char *) argv);
       return;
     }
+    if (argv[i][0] == '-' || argv[i][0] == '+')
+      continue;
     i++;
   }
   Tcl_Free((char *) argv);
@@ -1243,7 +1244,7 @@
     return;
   }
   if (channel_static(chan)) {
-    dprintf(idx, "Cannot remove %s, it is not a dynamic channel!.\n", chname);
+    dprintf(idx, "Cannot remove %s, it is a static channel!\n", chname);
     return;
   }
 
@@ -1360,8 +1361,9 @@
             (chan->status & CHAN_DYNAMICBANS) ? '+' : '-',
             (chan->status & CHAN_NOUSERBANS) ? '-' : '+',
             (chan->status & CHAN_AUTOHALFOP) ? '+' : '-');
-    dprintf(idx, "     %cprotecthalfops\n",
-            (chan->status & CHAN_PROTECTHALFOPS) ? '+' : '-');
+    dprintf(idx, "     %cprotecthalfops %cstatic\n",
+            (chan->status & CHAN_PROTECTHALFOPS) ? '+' : '-',
+            (chan->status & CHAN_STATIC) ? '+' : '-');
     dprintf(idx,
             "     %cdynamicexempts %cuserexempts    %cdynamicinvites "
             "%cuserinvites\n",
@@ -1508,6 +1510,12 @@
       while (list[0][0]) {
         if (list[0][0] == '+' || list[0][0] == '-' ||
             (!strcmp(list[0], "dont-idle-kick"))) {
+            if (!strcmp(list[0] + 1, "static") && must_be_owner &&
+                !(isowner(dcc[idx].nick))) {
+              dprintf(idx, "Only permanent owners can modify the static flag.\n");
+              nfree(buf);
+              return;
+            }
           if (tcl_channel_modify(0, chan, 1, list) == TCL_OK) {
             strcat(answers, list[0]);
             strcat(answers, " ");
@@ -1584,7 +1592,6 @@
   else {
     dprintf(idx, "Reloading all dynamic channel settings.\n");
     putlog(LOG_CMDS, "*", "#%s# chanload", dcc[idx].nick);
-    setstatic = 0;
     read_channels(1);
   }
 }
Index: eggdrop1.6/src/mod/channels.mod/help/chaninfo.help
diff -u eggdrop1.6/src/mod/channels.mod/help/chaninfo.help:1.16 eggdrop1.6/src/mod/channels.mod/help/chaninfo.help:1.17
--- eggdrop1.6/src/mod/channels.mod/help/chaninfo.help:1.16	Sat May 16 05:25:28 2009
+++ eggdrop1.6/src/mod/channels.mod/help/chaninfo.help	Wed Mar 24 07:14:50 2010
@@ -160,6 +160,7 @@
                        the bot from fighting with services such as ChanServ, or
                        from kicking IRCops when setting channel modes without
                        having ops.
+        %bstatic%b         Allow only permanent owners to remove the channel?
      The following are flood settings, they are set via ".chanset <channel>
      flood-type number:seconds", where number and second are integers
      indicating the number of times in how many seconds the flood will be
Index: eggdrop1.6/src/mod/channels.mod/tclchan.c
diff -u eggdrop1.6/src/mod/channels.mod/tclchan.c:1.104 eggdrop1.6/src/mod/channels.mod/tclchan.c:1.105
--- eggdrop1.6/src/mod/channels.mod/tclchan.c:1.104	Thu Feb 18 03:52:29 2010
+++ eggdrop1.6/src/mod/channels.mod/tclchan.c	Wed Mar 24 07:14:50 2010
@@ -1,7 +1,7 @@
 /*
  * tclchan.c -- part of channels.mod
  *
- * $Id: tclchan.c,v 1.104 2010/02/18 09:52:29 pseudo Exp $
+ * $Id: tclchan.c,v 1.105 2010/03/24 13:14:50 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -894,6 +894,10 @@
     Tcl_AppendElement(irp, "+nodesynch");
   else
     Tcl_AppendElement(irp, "-nodesynch");
+  if (chan->status & CHAN_STATIC)
+    Tcl_AppendElement(irp, "+static");
+  else
+    Tcl_AppendElement(irp, "-static");
   for (ul = udef; ul; ul = ul->next) {
     /* If it's undefined, skip it. */
     if (!ul->defined || !ul->name)
@@ -1004,6 +1008,7 @@
   else if CHKFLAG_POS(CHAN_CYCLE, "cycle", chan->status)
   else if CHKFLAG_POS(CHAN_SEEN, "seen", chan->status)
   else if CHKFLAG_POS(CHAN_NODESYNCH, "nodesynch", chan->status)
+  else if CHKFLAG_POS(CHAN_STATIC, "static", chan->status)
   else if CHKFLAG_POS(CHAN_DYNAMICEXEMPTS, "dynamicexempts",
                       chan->ircnet_status)
   else if CHKFLAG_NEG(CHAN_NOUSEREXEMPTS, "userexempts",
@@ -1319,6 +1324,10 @@
       chan->status |= CHAN_SEEN;
     else if (!strcmp(item[i], "-seen"))
       chan->status &= ~CHAN_SEEN;
+    else if (!strcmp(item[i], "+static"))
+      chan->status |= CHAN_STATIC;
+    else if (!strcmp(item[i], "-static"))
+      chan->status &= ~CHAN_STATIC;
     else if (!strcmp(item[i], "+dynamicexempts"))
       chan->ircnet_status |= CHAN_DYNAMICEXEMPTS;
     else if (!strcmp(item[i], "-dynamicexempts"))
@@ -1619,7 +1628,6 @@
     Tcl_AppendResult(irp, "no channel file", NULL);
     return TCL_ERROR;
   }
-  setstatic = 0;
   read_channels(1);
   return TCL_OK;
 }
@@ -1950,8 +1958,6 @@
     /* Channel name is stored in xtra field for sharebot stuff */
     join = 1;
   }
-  if (setstatic)
-    chan->status |= CHAN_STATIC;
   /* If chan_hack is set, we're loading the userfile. Ignore errors while
    * reading userfile and just return TCL_OK. This is for compatability
    * if a user goes back to an eggdrop that no-longer supports certain
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1246 eggdrop1.6/src/patch.h:1.1247
--- eggdrop1.6/src/patch.h:1.1246	Tue Mar 23 09:25:29 2010
+++ eggdrop1.6/src/patch.h	Wed Mar 24 07:14:50 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1246 2010/03/23 15:25:29 pseudo Exp $
+ * $Id: patch.h,v 1.1247 2010/03/24 13:14:50 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1269357654");            /* current unixtime */
+patch("1269436354");            /* current unixtime */
 /*
  *
  *
  */
-patch("plschanfix");
+patch("newstaticchans");
 /*
  *
  *
----------------------- End of diff -----------------------


More information about the Changes mailing list