Add a "whoami" command to report to the user who he has identified as.
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 17 Feb 2010 15:28:50 +0000 (15:28 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 17 Feb 2010 15:28:50 +0000 (15:28 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@109 088b83a4-0077-4247-935c-42ec02c2848b

commands.yaml

index 68cbf15..f21cad1 100644 (file)
@@ -219,6 +219,17 @@ UNIDENTIFY: |-
       $kernel->post( $src, $replypath, "$who: You are not identified.", $dest );
     }
   }
+
+WHOAMI: |-
+  sub {
+    my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
+    if( exists( $heap->{ 'identified' } ) && exists( $heap->{ 'identified' }->{ $src.uc( $who ) } ) ) {
+      $kernel->post( $src, $replypath, "$who: You are identified as ".$heap->{ 'identified' }->{ $src.uc( $who ) }, $dest );
+    } else {
+      $kernel->post( $src, $replypath, "$who: You are not identified.", $dest );
+    }
+  }
+
 IDENTIFY: |-
   sub {
     use Digest::MD5 qw( md5_hex );