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

cvs at eggheads.org cvs at eggheads.org
Sun Nov 15 07:10:44 CST 2009


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2009-11-15 13:10:44 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     doc/Changes1.6 src/cmds.c src/flags.c src/patch.h src/tcluser.c

Log message:

Modified build_flags() to not repeat global bot flags when both bot and chan flags are requested.

Fixed tcl_botattr() and tcl_chattr() to return only bot-specific or user-specific flags respectively.
Fixes Bugzilla Bug # 484 "botattr tcl command returns bot channel flags incorrectly"

Found by: Pixelz / Patch by: pseudo

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.45 eggdrop1.6/doc/Changes1.6:1.46
--- eggdrop1.6/doc/Changes1.6:1.45	Sat Oct 31 09:18:03 2009
+++ eggdrop1.6/doc/Changes1.6	Sun Nov 15 07:10:34 2009
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.45 2009/10/31 15:18:03 thommey Exp $
+$Id: Changes1.6,v 1.46 2009/11/15 13:10:34 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,14 @@
 
 1.6.20 (CVS):
 
+  - Modified build_flags() to not repeat global bot flags when both bot
+    and chan flags are requested.
+  - Fixed tcl_botattr() and tcl_chattr() to return only bot-specific or
+    user-specific flags respectively.
+    Fixes Bugzilla Bug # 484 "botattr tcl command returns bot channel flags
+    incorrectly"
+    Found by: Pixelz / Patch by: pseudo
+
   - Make _wild_match_per more flexible with dynamic comparison functions.
   - Make mode binds case-sensitive for the mode change. Fixes Bug # 476.
     Patch by: thommey
Index: eggdrop1.6/src/cmds.c
diff -u eggdrop1.6/src/cmds.c:1.120 eggdrop1.6/src/cmds.c:1.121
--- eggdrop1.6/src/cmds.c:1.120	Sun Oct 25 04:57:52 2009
+++ eggdrop1.6/src/cmds.c	Sun Nov 15 07:10:34 2009
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  *
- * $Id: cmds.c,v 1.120 2009/10/25 10:57:52 pseudo Exp $
+ * $Id: cmds.c,v 1.121 2009/11/15 13:10:34 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1757,6 +1757,7 @@
     user.match = FR_CHAN;
     get_user_flagrec(u2, &user, par);
     user.chan &= BOT_SHARE;
+    user.udef_chan = 0; /* udef chan flags are user only */
     build_flags(work, &user, NULL);
     if (work[0] != '-')
       dprintf(idx, "Bot flags for %s on %s are now +%s.\n", hand,
Index: eggdrop1.6/src/flags.c
diff -u eggdrop1.6/src/flags.c:1.34 eggdrop1.6/src/flags.c:1.35
--- eggdrop1.6/src/flags.c:1.34	Sat Feb 16 15:41:03 2008
+++ eggdrop1.6/src/flags.c	Sun Nov 15 07:10:34 2009
@@ -2,7 +2,7 @@
  * flags.c -- handles:
  *   all the flag matching/conversion functions in one neat package :)
  *
- * $Id: flags.c,v 1.34 2008/02/16 21:41:03 guppy Exp $
+ * $Id: flags.c,v 1.35 2009/11/15 13:10:34 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -479,6 +479,8 @@
     x++;
     bot >>= 1;
   }
+  if (string == old)
+    *string++ = '-';
   return string - old;
 }
 
@@ -516,16 +518,6 @@
       string += flag2str(string, minus->global, minus->udef_chan);
     }
   }
-  if ((plus->match & (FR_BOT | FR_CHAN)) == (FR_BOT | FR_CHAN)) {
-    *string++ = (plus->match & FR_AND) ? '&' : '|';
-    if (minus && plus->bot)
-      *string++ = '+';
-    string += bot2str(string, plus->bot);
-    if (minus && minus->bot) {
-      *string++ = '-';
-      string += bot2str(string, minus->bot);
-    }
-  }
   if (string == old) {
     *string++ = '-';
     *string = 0;
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1219 eggdrop1.6/src/patch.h:1.1220
--- eggdrop1.6/src/patch.h:1.1219	Sat Oct 31 09:18:03 2009
+++ eggdrop1.6/src/patch.h	Sun Nov 15 07:10:34 2009
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1219 2009/10/31 15:18:03 thommey Exp $
+ * $Id: patch.h,v 1.1220 2009/11/15 13:10:34 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1257000721");            /* current unixtime */
+patch("1258232619");            /* current unixtime */
 /*
  *
  *
  */
-patch("bindmodecase");
+patch("botattrfix");
 /*
  *
  *
Index: eggdrop1.6/src/tcluser.c
diff -u eggdrop1.6/src/tcluser.c:1.45 eggdrop1.6/src/tcluser.c:1.46
--- eggdrop1.6/src/tcluser.c:1.45	Sat Nov  1 14:41:10 2008
+++ eggdrop1.6/src/tcluser.c	Sun Nov 15 07:10:34 2009
@@ -2,7 +2,7 @@
  * tcluser.c -- handles:
  *   Tcl stubs for the user-record-oriented commands
  *
- * $Id: tcluser.c,v 1.45 2008/11/01 20:41:10 tothwolf Exp $
+ * $Id: tcluser.c,v 1.46 2009/11/15 13:10:34 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -121,6 +121,7 @@
     Tcl_AppendResult(irp, "no such channel", NULL);
     return TCL_ERROR;
   }
+  /* Retrieve current flags */
   get_user_flagrec(u, &user, chan);
   /* Make changes */
   if (chg) {
@@ -145,7 +146,8 @@
     }
     set_user_flagrec(u, &user, chan);
   }
-  /* Retrieve current flags and return them */
+  user.chan &= ~BOT_SHARE; /* actually not an user flag, hide it */
+  /* Build flag string */
   build_flags(work, &user, NULL);
   Tcl_AppendResult(irp, work, NULL);
   return TCL_OK;
@@ -203,6 +205,7 @@
     Tcl_AppendResult(irp, "no such channel", NULL);
     return TCL_ERROR;
   }
+  /* Retrieve current flags */
   get_user_flagrec(u, &user, chan);
   /* Make changes */
   if (chg) {
@@ -220,7 +223,12 @@
     }
     set_user_flagrec(u, &user, chan);
   }
-  /* Retrieve current flags and return them */
+  /* Only user flags can be set per channel, not bot ones,
+     so BOT_SHARE is a hack to allow botattr |+s */
+  user.chan &= BOT_SHARE;
+  user.udef_chan = 0; /* User definable bot flags are global only,
+                         anything here is a regular flag, so hide it. */
+  /* Build flag string */
   build_flags(work, &user, NULL);
   Tcl_AppendResult(irp, work, NULL);
   return TCL_OK;
----------------------- End of diff -----------------------


More information about the Changes mailing list