Fixed bug with counting messages
authorAndrew DeFaria <Andrew@DeFaria.com>
Sun, 18 Jul 2021 04:18:19 +0000 (21:18 -0700)
committerAndrew DeFaria <Andrew@DeFaria.com>
Sun, 18 Jul 2021 04:18:19 +0000 (21:18 -0700)
maps/bin/processaction.cgi
maps/lib/MAPS.pm

index 7422b74..229a2c3 100755 (executable)
@@ -102,7 +102,10 @@ sub PrintInputLine ($$$$$) {
       ($pattern, $domain) = split /\@/, $email;
     } # if
 
-    $hit_count = CountMsg($email);
+    $hit_count = CountEmail(
+      userid => $userid,
+      additional => "sender like '%$email%'",
+    );
   } # if
 
   print Tr [
index 8a764cf..618fb67 100644 (file)
@@ -291,7 +291,7 @@ sub AddList(%) {
 
   $rec{hit_count} //= $db->count(
     'email',
-    "userid = '$rec{userid}' and sender like '$rec{sender}%'"
+    "userid = '$rec{userid}' and sender like '%$rec{sender}%'"
   );
 
   ($rec{pattern}, $rec{domain}) = split /\@/, delete $rec{sender};