# -*- mode: perl -*-
use warnings;
use strict;

my %buzzfilter = ();
{
    no warnings 'redefine';
    sub BarnOwl::Message::body {
        my $m = shift;
        if($buzzfilter{$m->pretty_sender||""}) {
            my $b = $m->{body};
            $b =~ s/[^\saeiou]/z/ig;
            return $b;
        } else {
            return $m->{body}
        }
    }
}

BarnOwl::new_command(buzzfilter => sub {$buzzfilter{$_[1]} = 1});
BarnOwl::new_command(debuzzfilter => sub {delete $buzzfilter{$_[1]}});
BarnOwl::alias(unbuzzfilter => 'debuzzfilter');
