Make ignore case insensitive
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Sun, 20 Jan 2008 03:11:15 +0000 (03:11 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Sun, 20 Jan 2008 03:11:15 +0000 (03:11 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@33 088b83a4-0077-4247-935c-42ec02c2848b

commands.yaml
core.pl

index 61913e1..c412e4f 100644 (file)
@@ -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 (file)
--- 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;
        }