if ($addressed) {
my $time = $flood{$floodwho}{$message} || 0;
- if (!&hasFlag("o") and $msgType eq "public" and (time() - $time < $interval)) {
+ if (!&IsFlag('o') and $msgType eq "public" and (time() - $time < $interval)) {
### public != personal who so the below is kind of pointless.
my @who;
foreach (keys %flood) {
} 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/\Q$1\E/\Q$2\E/$3;";
+ if ($sedmsg ne $seencache{$who}{'msg'}) {
+ &DEBUG("sed \"" . $orig{message} . "\" \"" .
+ $seencache{$who}{'msg'} . "\" \"" . $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;