From 15503f0883a2e8905744332f44c579556385026a Mon Sep 17 00:00:00 2001 From: timriker Date: Fri, 22 Nov 2002 00:19:53 +0000 Subject: [PATCH] fix check for more than one botmsgs git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@676 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/Modules/botmail.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/blootbot/src/Modules/botmail.pl b/blootbot/src/Modules/botmail.pl index be134d1..6f5d105 100644 --- a/blootbot/src/Modules/botmail.pl +++ b/blootbot/src/Modules/botmail.pl @@ -39,11 +39,10 @@ sub check { $recipient ||= $::who; # todo: simplify this select (use a diff function) - my @from = &::dbGet("botmail", "srcwho", - "dstwho=".&::dbQuote(lc $recipient) - ); - my $t = scalar @from; - my $from = join(", ", @from); + my %from = &::dbGetCol("botmail", "srcwho", + "dstwho=".&::dbQuote(lc $recipient),2); + my $t = keys %from; + my $from = join(", ", keys %from); if ($t == 0) { &::msg($recipient, "You have no botmail."); @@ -67,7 +66,7 @@ sub next { my $ago = &::Time2String(time() - $hash{'time'}); &::msg($recipient, "From $hash{srcwho} ($hash{srcuh}) on $hash{time} [$ago]:"); &::msg($recipient, $hash{'msg'}); - #&::dbDel("botmail", "id", $hash{id}); + #&::dbDel("botmail", "id", $hash{id}); # FIXME need a way to delete from 2 keys (hash) } } -- 2.39.5