changeset 21:a54f26f2f7fd

Fix no-lol list bug: strip colours from chatter's name
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Wed, 16 Feb 2011 16:39:24 -0600
parents 21d4f54b2b25
children 8ebcdfa03782
files teh-lol.pl
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/teh-lol.pl
+++ b/teh-lol.pl
@@ -49,6 +49,9 @@
   my $chan = Xchat::get_info("channel");
   my $timesince_lasttalk = time - Xchat::user_info -> {'lasttalk'};
 
+  ## Chatter name without possible colour codes
+  my $chatter = Xchat::strip_code($_[0][0]);
+
   #Match stuff like "lol", "loool" and "lololol"
   if ($_[0][1] =~ /\b(l((o|(?<!l)lo)+)l)\b/i
 
@@ -57,7 +60,7 @@
       and $timesince_lasttalk < 120
 
       #Enemies of the lols are abusing the lol, no lols for them.
-      and not grep(/$_[0][0]/, @no_lol_list) ) {
+      and not grep(/$chatter/, @no_lol_list) ) {
 
     my $lol = $1;
     my $midlol = $2;
@@ -90,7 +93,7 @@
 
       Xchat::hook_timer($delay,
                         sub {
-                          Xchat::command("say $relol");
+                          #Xchat::command("say $relol");
                           return Xchat::REMOVE;
                         }
                         );