]> git.donarmstrong.com Git - infobot.git/commitdiff
fix check for more than one botmsgs
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 22 Nov 2002 00:19:53 +0000 (00:19 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 22 Nov 2002 00:19:53 +0000 (00:19 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@676 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/Modules/botmail.pl

index be134d10cea0d3ee8784557133780ad5058d50d9..6f5d10593b74c730dc1bacf2de9112f608ec2ca3 100644 (file)
@@ -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)
     }
 }