From 54aa931f489da7eaae11d092fec29757e333f843 Mon Sep 17 00:00:00 2001 From: pdbogen Date: Wed, 17 Feb 2010 15:28:50 +0000 Subject: [PATCH] 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 --- commands.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 ); -- 2.11.0