IGNORE: |-
sub {
my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
- $what =~ s/[[:space:]]+$//;
+ if( $what =~ /^[[:space:]]*$/ ) {
+ $kernel->post( $src, $replypath, "The following users are ignored: ".join( ' ', keys(%{ $heap->{ 'ignored' } })), $dest );
+ return;
+ }
+ $what =~ s/[[:space:]]*$//;
+ $what =~ s/^[[:space:]]*//;
if( exists( $heap->{ 'ignored' }->{ uc( $what ) } ) ) {
$kernel->post( $src, $replypath, "'$what' is already ignored.", $dest );
return;
$heap->{ 'ignored' }->{ uc( $what ) } = $who;
$kernel->post( $src, $replypath, "'$what' is now ignored.", $dest );
DumpFile( "ignored.yaml", $heap->{ 'ignored' } );
+ print( "IGNORE: $who marks $what ignored\n" );
}
UNIGNORE: |-
sub {
my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
+ if( $what =~ /^[[:space:]]*$/ ) {
+ $kernel->post( $src, $replypath, "Usage: UNIGNORE <name>", $dest );
+ return;
+ }
$what =~ s/[[:space:]]+$//;
+ $what =~ s/^[[:space:]]+//;
if( exists( $heap->{ 'ignored' }->{ uc( $what ) } ) ) {
delete $heap->{ 'ignored' }->{ uc( $what ) };
$kernel->post( $src, $replypath, "'$what' is no longer ignored.", $dest );
return;
}
$kernel->post( $src, $replypath, "'$what' is not ignored.", $dest );
+ print( "UNIGNORE: $who marks $what unignored\n" );
}
REPLACE: |-