From cd14dd954909f8b1b5565be1d70e3e98be07a1eb Mon Sep 17 00:00:00 2001 From: timriker Date: Fri, 22 Nov 2002 08:16:58 +0000 Subject: [PATCH] eep, don't alway say 'You have no botmail.' git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@688 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/Modules/botmail.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blootbot/src/Modules/botmail.pl b/blootbot/src/Modules/botmail.pl index 6d40cd9..5bda414 100644 --- a/blootbot/src/Modules/botmail.pl +++ b/blootbot/src/Modules/botmail.pl @@ -27,8 +27,8 @@ sub parse { if ($what =~ /^(for|add)\s+(.*)$/i) { &add( split(/\s+/, $2, 2) ); - } elsif ($what =~ /^check(\s+(.*))?$/i) { - &check( split(/\s+/, $1, 2) ); + } elsif ($what =~ /^check?$/i) { + &check( $1, 1); } elsif ($what =~ /^(read|next)$/i) { # TODO: read specific items? nah, will make this too complex. @@ -38,9 +38,9 @@ sub parse { } ##### -# Usage: botmail::check($recipient) +# Usage: botmail::check($recipient, [$always]) sub check { - my($recipient) = @_; + my($recipient, $always) = @_; $recipient ||= $::who; # todo: simplify this select (use a diff function) @@ -50,7 +50,7 @@ sub check { my $from = join(", ", keys %from); if ($t == 0) { - &::msg($recipient, "You have no botmail."); + &::msg($recipient, "You have no botmail.") if ($always); } else { &::msg($recipient, "You have $t messages awaiting, from: $from"); } -- 2.39.5