[832] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r826 - trunk/owl/perl/modules/IRC/lib/BarnOwl/Module/IRC

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:10:11 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Thu, 10 Jan 2008 15:58:50 -0500 (EST)

Author: nelhage
Date: 2008-01-10 15:58:49 -0500 (Thu, 10 Jan 2008)
New Revision: 826

Modified:
   trunk/owl/perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
Log:
strip IRC coloring from IRC messages

Modified: trunk/owl/perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
===================================================================
--- trunk/owl/perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm	2008-01-10 20:49:27 UTC (rev 825)
+++ trunk/owl/perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm	2008-01-10 20:58:49 UTC (rev 826)
@@ -160,7 +160,12 @@
 
 sub strip_irc_formatting {
     my $body = shift;
-    my @pieces = split /\x02/, $body;
+    # Strip mIRC colors. If someone wants to write code to convert
+    # these to zephyr colors, be my guest.
+    $body =~ s/\cC\d+(?:,\d+)?//g;
+    $body =~ s/\cO//g;
+    
+    my @pieces = split /\cB/, $body;
      my $out;
     while(@pieces) {
         $out .= shift @pieces;


home help back first fref pref prev next nref lref last post