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

cvs at eggheads.org cvs at eggheads.org
Fri Jun 22 17:35:43 CST 2012


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.8
Commit time: 2012-06-22 23:35:43 UTC
Committer  : Thomas Sader <thommey at gmail.com>

Modified files:
     doc/Changes1.8 doc/tcl-commands.doc doc/html/tcl-commands.html
     src/cmds.c src/dcc.c src/eggdrop.h src/patch.h src/tclmisc.c

Log message:

add stripcodes flag to strip italics and rename code for stripcodes o

---------------------- diff included ----------------------
Index: eggdrop1.8/doc/Changes1.8
diff -u eggdrop1.8/doc/Changes1.8:1.62 eggdrop1.8/doc/Changes1.8:1.63
--- eggdrop1.8/doc/Changes1.8:1.62	Fri Jun 22 15:38:54 2012
+++ eggdrop1.8/doc/Changes1.8	Fri Jun 22 17:35:32 2012
@@ -1,4 +1,4 @@
-$Id: Changes1.8,v 1.62 2012/06/22 21:38:54 thommey Exp $
+$Id: Changes1.8,v 1.63 2012/06/22 23:35:32 thommey Exp $
 
 Eggdrop Changes (since version 1.8.0)
 
@@ -6,6 +6,11 @@
 
 1.8.0 (CVS):
 
+
+  - Added a [stripcodes] flag to remove mIRC's italics (ascii 29).
+  - Refactored code to clarify 'o' means "ordinary".
+    Patch by: thommey / Found by: speechles
+
   - Added a [stripcodes] flag to remove mIRC's CTRL+o (ascii 15) which
     terminates all bold, underline, color. Also added * to strip everything.
     Patch by: thommey / Found by: SpiKe, ealexp
Index: eggdrop1.8/doc/html/tcl-commands.html
diff -u eggdrop1.8/doc/html/tcl-commands.html:1.11 eggdrop1.8/doc/html/tcl-commands.html:1.12
--- eggdrop1.8/doc/html/tcl-commands.html:1.11	Fri Jun 22 15:38:54 2012
+++ eggdrop1.8/doc/html/tcl-commands.html	Fri Jun 22 17:35:32 2012
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: tcl-commands.html,v 1.11 2012/06/22 21:38:54 thommey Exp $ -->
+<!-- $Id: tcl-commands.html,v 1.12 2012/06/22 23:35:32 thommey Exp $ -->
 
 <html>
   <head>
@@ -3681,12 +3681,21 @@
                 </td>
 
                 <td>
-                  <p>remove all reset codes (mIRC ctrl+o, ascii 15)</p>
+                  <p>remove all ordinary codes (ctrl+o, terminates bold/color/..)</p>
                 </td>
               </tr>
 
               <tr valign="top">
                 <td>
+                  <p><strong>o</strong></p>
+                </td>
+
+                <td>
+                  <p>remove all italics codes</p>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td>
                   <p><strong>*</strong></p>
                 </td>
 
Index: eggdrop1.8/doc/tcl-commands.doc
diff -u eggdrop1.8/doc/tcl-commands.doc:1.10 eggdrop1.8/doc/tcl-commands.doc:1.11
--- eggdrop1.8/doc/tcl-commands.doc:1.10	Fri Jun 22 15:38:54 2012
+++ eggdrop1.8/doc/tcl-commands.doc	Fri Jun 22 17:35:32 2012
@@ -1,4 +1,4 @@
-$Id: tcl-commands.doc,v 1.10 2012/06/22 21:38:54 thommey Exp $
+$Id: tcl-commands.doc,v 1.11 2012/06/22 23:35:32 thommey Exp $
 
 Eggdrop Tcl Commands
 Last revised: October 24, 2010
@@ -1595,7 +1595,8 @@
         u - remove all underline codes
         a - remove all ANSI codes
         g - remove all ctrl-g (bell) codes
-        o - remove all reset codes (mIRC ctrl+o, ascii 15)
+        o - remove all ordinary codes (ctrl+o, terminates bold/color/..)
+        i - remove all italics codes
         * - remove all of the above
     Returns: the stripped string.
     Module: core
Index: eggdrop1.8/src/cmds.c
diff -u eggdrop1.8/src/cmds.c:1.5 eggdrop1.8/src/cmds.c:1.6
--- eggdrop1.8/src/cmds.c:1.5	Fri Jun 22 15:38:54 2012
+++ eggdrop1.8/src/cmds.c	Fri Jun 22 17:35:33 2012
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  *
- * $Id: cmds.c,v 1.5 2012/06/22 21:38:54 thommey Exp $
+ * $Id: cmds.c,v 1.6 2012/06/22 23:35:33 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -2007,10 +2007,16 @@
       res |= STRIP_COLOR;
       break;
     case 'r':
-      res |= STRIP_REV;
+      res |= STRIP_REVERSE;
       break;
     case 'u':
-      res |= STRIP_UNDER;
+      res |= STRIP_UNDERLINE;
+      break;
+    case 'i':
+      res |= STRIP_ITALICS;
+      break;
+    case 'o':
+      res |= STRIP_ORDINARY;
       break;
     case 'a':
       res |= STRIP_ANSI;
@@ -2018,9 +2024,6 @@
     case 'g':
       res |= STRIP_BELLS;
       break;
-    case 'o':
-      res |= STRIP_RESET;
-      break;
     case '*':
       res |= STRIP_ALL;
       break;
@@ -2037,16 +2040,18 @@
     *p++ = 'b';
   if (x & STRIP_COLOR)
     *p++ = 'c';
-  if (x & STRIP_REV)
+  if (x & STRIP_REVERSE)
     *p++ = 'r';
-  if (x & STRIP_UNDER)
+  if (x & STRIP_ITALICS)
+    *p++ = 'i';
+  if (x & STRIP_ORDINARY)
+    *p++ = 'o';
+  if (x & STRIP_UNDERLINE)
     *p++ = 'u';
   if (x & STRIP_ANSI)
     *p++ = 'a';
   if (x & STRIP_BELLS)
     *p++ = 'g';
-  if (x & STRIP_RESET)
-    *p++ = 'o';
   if (p == s)
     *p++ = '-';
   *p = 0;
@@ -2063,16 +2068,18 @@
     i += my_strcpy(s + i, "bold, ");
   if (x & STRIP_COLOR)
     i += my_strcpy(s + i, "color, ");
-  if (x & STRIP_REV)
+  if (x & STRIP_REVERSE)
     i += my_strcpy(s + i, "reverse, ");
-  if (x & STRIP_UNDER)
+  if (x & STRIP_UNDERLINE)
     i += my_strcpy(s + i, "underline, ");
+  if (x & STRIP_ITALICS)
+    i += my_strcpy(s + i, "italics, ");
+  if (x & STRIP_ORDINARY)
+    i += my_strcpy(s + i, "ordinary, ");
   if (x & STRIP_ANSI)
     i += my_strcpy(s + i, "ansi, ");
   if (x & STRIP_BELLS)
     i += my_strcpy(s + i, "bells, ");
-  if (x & STRIP_RESET)
-    i += my_strcpy(s + i, "reset, ");
   if (!i)
     strcpy(s, "none");
   else
Index: eggdrop1.8/src/dcc.c
diff -u eggdrop1.8/src/dcc.c:1.12 eggdrop1.8/src/dcc.c:1.13
--- eggdrop1.8/src/dcc.c:1.12	Fri Jun 22 15:38:55 2012
+++ eggdrop1.8/src/dcc.c	Fri Jun 22 17:35:33 2012
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.12 2012/06/22 21:38:55 thommey Exp $
+ * $Id: dcc.c,v 1.13 2012/06/22 23:35:33 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -824,20 +824,26 @@
         continue;
       }
       break;
-    case 017:                  /* Reset all control chars (mIRC ctrl+o) */
-      if (flags & STRIP_RESET) {
+    case 017:                  /* Ordinary (mIRC ctrl+o) */
+      if (flags & STRIP_ORDINARY) {
         text++;
         continue;
       }
       break;
     case 0x16:                 /* Reverse video */
-      if (flags & STRIP_REV) {
+      if (flags & STRIP_REVERSE) {
+        text++;
+        continue;
+      }
+      break;
+    case 29:                   /* Italics */
+      if (flags & STRIP_ITALICS) {
         text++;
         continue;
       }
       break;
     case 0x1f:                 /* Underlined text */
-      if (flags & STRIP_UNDER) {
+      if (flags & STRIP_UNDERLINE) {
         text++;
         continue;
       }
Index: eggdrop1.8/src/eggdrop.h
diff -u eggdrop1.8/src/eggdrop.h:1.7 eggdrop1.8/src/eggdrop.h:1.8
--- eggdrop1.8/src/eggdrop.h:1.7	Fri Jun 22 15:38:55 2012
+++ eggdrop1.8/src/eggdrop.h	Fri Jun 22 17:35:33 2012
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.7 2012/06/22 21:38:55 thommey Exp $
+ * $Id: eggdrop.h,v 1.8 2012/06/22 23:35:33 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -553,14 +553,15 @@
 #define STAT_PAGE    0x00080    /* page output to the user              */
 
 /* For stripping out mIRC codes. */
-#define STRIP_COLOR  0x00001    /* remove mIRC color codes              */
-#define STRIP_BOLD   0x00002    /* remove bold codes                    */
-#define STRIP_REV    0x00004    /* remove reverse video codes           */
-#define STRIP_UNDER  0x00008    /* remove underline codes               */
-#define STRIP_ANSI   0x00010    /* remove ALL ANSI codes                */
-#define STRIP_BELLS  0x00020    /* remove ctrl-g's                      */
-#define STRIP_RESET  0x00040    /* remove mirc ctrl+o                   */
-#define STRIP_ALL    0x0007F    /* remove every damn thing!             */
+#define STRIP_COLOR     0x00001    /* remove mIRC color codes            */
+#define STRIP_BOLD      0x00002    /* remove bold codes                  */
+#define STRIP_REVERSE   0x00004    /* remove reverse video codes         */
+#define STRIP_UNDERLINE 0x00008    /* remove underline codes             */
+#define STRIP_ANSI      0x00010    /* remove ALL ANSI codes              */
+#define STRIP_BELLS     0x00020    /* remove ctrl-g's                    */
+#define STRIP_ORDINARY  0x00040    /* remove ordinary codes              */
+#define STRIP_ITALICS   0x00080    /* remove italics codes               */
+#define STRIP_ALL       0x000FF    /* remove every damn thing!           */
 
 /* For dcc bot links. */
 #define STAT_PINGED  0x00001    /* waiting for ping to return            */
Index: eggdrop1.8/src/patch.h
diff -u eggdrop1.8/src/patch.h:1.43 eggdrop1.8/src/patch.h:1.44
--- eggdrop1.8/src/patch.h:1.43	Fri Jun 22 15:38:55 2012
+++ eggdrop1.8/src/patch.h	Fri Jun 22 17:35:33 2012
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.43 2012/06/22 21:38:55 thommey Exp $
+ * $Id: patch.h,v 1.44 2012/06/22 23:35:33 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1340400707");            /* current unixtime */
+patch("1340407724");            /* current unixtime */
 /*
  *
  *
  */
-patch("stripmore");
+patch("stripmoar");
 /*
  *
  *
Index: eggdrop1.8/src/tclmisc.c
diff -u eggdrop1.8/src/tclmisc.c:1.6 eggdrop1.8/src/tclmisc.c:1.7
--- eggdrop1.8/src/tclmisc.c:1.6	Fri Jun 22 15:38:55 2012
+++ eggdrop1.8/src/tclmisc.c	Fri Jun 22 17:35:33 2012
@@ -2,7 +2,7 @@
  * tclmisc.c -- handles:
  *   Tcl stubs for everything else
  *
- * $Id: tclmisc.c,v 1.6 2012/06/22 21:38:55 thommey Exp $
+ * $Id: tclmisc.c,v 1.7 2012/06/22 23:35:33 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -672,17 +672,20 @@
     case 'c':
       flags |= STRIP_COLOR;
       break;
+    case 'o':
+      flags |= STRIP_ORDINARY;
+      break;
+    case 'i':
+      flags |= STRIP_ITALICS;
+      break;
     case 'g':
       flags |= STRIP_BELLS;
       break;
     case 'r':
-      flags |= STRIP_REV;
+      flags |= STRIP_REVERSE;
       break;
     case 'u':
-      flags |= STRIP_UNDER;
-      break;
-    case 'o':
-      flags |= STRIP_RESET;
+      flags |= STRIP_UNDERLINE;
       break;
     case '*':
       flags |= STRIP_ALL;
----------------------- End of diff -----------------------


More information about the Changes mailing list