# HG changeset patch # User Jordi GutiƩrrez Hermoso <jordigh@gmail.com> # Date 1297796961 21600 # Node ID 21d4f54b2b25d506e6d9144cbd63c8843d8a3c9b # Parent a7406b7600ab2bc5ca0d58a2ccce98de9c35638d Implement no-lol list diff --git a/teh-lol.pl b/teh-lol.pl --- a/teh-lol.pl +++ b/teh-lol.pl @@ -35,16 +35,29 @@ return Xchat::EAT_NONE; } +my @no_lol_list; + +if (open FILE, $ENV{"HOME"}."/.xchat2/no-lol") { + while (<FILE>) { + chomp; + push @no_lol_list, $_; + } + close(FILE); +} + sub check_lol { my $chan = Xchat::get_info("channel"); my $timesince_lasttalk = time - Xchat::user_info -> {'lasttalk'}; - if ($_[0][1] =~ /\b(l((o|(?<!l)lo)+)l)\b/i #Match stuff like "lol", - #"loool" and "lololol" - and $timesince_lasttalk < 120) { #Two minutes of not saying - #anything in the channel - #counts as idling, so don't - #pester when idling. + #Match stuff like "lol", "loool" and "lololol" + if ($_[0][1] =~ /\b(l((o|(?<!l)lo)+)l)\b/i + + #Two minutes of not saying anything in the channel counts as + #idling, so don't pester when idling. + and $timesince_lasttalk < 120 + + #Enemies of the lols are abusing the lol, no lols for them. + and not grep(/$_[0][0]/, @no_lol_list) ) { my $lol = $1; my $midlol = $2;