From 9765aca20a4ee30fa01dfeb2b5ca6bfd8f50332e Mon Sep 17 00:00:00 2001 From: pdbogen Date: Sun, 20 Jan 2008 03:11:15 +0000 Subject: [PATCH] Make ignore case insensitive git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@33 088b83a4-0077-4247-935c-42ec02c2848b --- commands.yaml | 8 ++++---- core.pl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commands.yaml b/commands.yaml index 61913e1..c412e4f 100644 --- a/commands.yaml +++ b/commands.yaml @@ -869,11 +869,11 @@ IGNORE: |- sub { my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_; $what =~ s/[[:space:]]+$//; - if( exists( $heap->{ 'ignored' }->{ $what } ) ) { + if( exists( $heap->{ 'ignored' }->{ uc( $what ) } ) ) { $kernel->post( $src, $replypath, "'$what' is already ignored.", $dest ); return; } - $heap->{ 'ignored' }->{ $what } = $who; + $heap->{ 'ignored' }->{ uc( $what ) } = $who; $kernel->post( $src, $replypath, "'$what' is now ignored.", $dest ); DumpFile( "ignored.yaml", $heap->{ 'ignored' } ); } @@ -882,8 +882,8 @@ UNIGNORE: |- sub { my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_; $what =~ s/[[:space:]]+$//; - if( exists( $heap->{ 'ignored' }->{ $what } ) ) { - delete $heap->{ 'ignored' }->{ $what }; + if( exists( $heap->{ 'ignored' }->{ uc( $what ) } ) ) { + delete $heap->{ 'ignored' }->{ uc( $what ) }; $kernel->post( $src, $replypath, "'$what' is no longer ignored.", $dest ); DumpFile( "ignored.yaml", $heap->{ 'ignored' } ); return; diff --git a/core.pl b/core.pl index 3545c0a..712f78d 100644 --- a/core.pl +++ b/core.pl @@ -131,7 +131,7 @@ sub cmd { $what =~ s/^[~]//; my( $cmd, $subj ) = ( split( / /, $what, 2 ) ); $subj = "" unless $subj; - if( exists( $heap->{ 'ignored' }->{ $who } ) ) { + if( exists( $heap->{ 'ignored' }->{ uc( $who ) } ) ) { print( "CORE:!<$who> $cmd -- $subj\n" ) unless( !exists $Destult::config{ 'DEBUG' } ); return; } -- 2.11.0