From: pdbogen Date: Wed, 17 Feb 2010 15:28:50 +0000 (+0000) Subject: Add a "whoami" command to report to the user who he has identified as. X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=54aa931f489da7eaae11d092fec29757e333f843;p=destult.git Add a "whoami" command to report to the user who he has identified as. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@109 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/commands.yaml b/commands.yaml index 68cbf15..f21cad1 100644 --- a/commands.yaml +++ b/commands.yaml @@ -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 );