From fc81ffdd153cacfd0c4fe670e44ce2b12eaae3e9 Mon Sep 17 00:00:00 2001 From: timriker Date: Sat, 7 Jan 2006 05:35:17 +0000 Subject: [PATCH] sedbot git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1259 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/IRC/IrcHelpers.pl | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/IRC/IrcHelpers.pl b/src/IRC/IrcHelpers.pl index 2e8e31a..ccc0d40 100644 --- a/src/IRC/IrcHelpers.pl +++ b/src/IRC/IrcHelpers.pl @@ -224,16 +224,22 @@ sub hookMsg { } elsif ($msgType =~ /private/i) { # private. &status("[$orig{who}] $orig{message}"); $talkchannel = undef; - $chan = "_default"; + $chan = '_default'; } else { &DEBUG("unknown msgType => $msgType."); } - push(@ignore, keys %{ $ignore{"*"} }) if (exists $ignore{"*"}); - - if ((!$skipmessage or &IsChanConf("seenStoreAll") > 0) and - &IsChanConf("seen") > 0 and - $msgType =~ /public/ - ) { + push(@ignore, keys %{ $ignore{'*'} }) if (exists $ignore{'*'}); + + if ((!$skipmessage or &IsChanConf('seenStoreAll') > 0) and + &IsChanConf('sed') > 0 and &IsChanConf('seen') > 0 and + $msgType =~ /public/ and + $orig{message} =~ /^s\/([^;\/]*)\/([^;\/]*)\/([g]*)$/) { + my $sedmsg = $seencache{$who}{'msg'}; + eval "\$sedmsg =~ s/$1/$2/$3;" + &DEBUG("sed \"$orig{message}\" \"$sedmsg\""); + &msg($talkchannel, "$orig{who} meant: $sedmsg"); + } elsif ((!$skipmessage or &IsChanConf('seenStoreAll') > 0) and + &IsChanConf('seen') > 0 and $msgType =~ /public/) { $seencache{$who}{'time'} = time(); $seencache{$who}{'nick'} = $orig{who}; $seencache{$who}{'host'} = $uh; -- 2.39.2