From f6c2a9114dff9bf8882180bbf49ed6b3e3533a91 Mon Sep 17 00:00:00 2001 From: Andrew DeFaria Date: Sat, 17 Jul 2021 21:18:19 -0700 Subject: [PATCH] Fixed bug with counting messages --- maps/bin/processaction.cgi | 5 ++++- maps/lib/MAPS.pm | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/maps/bin/processaction.cgi b/maps/bin/processaction.cgi index 7422b74..229a2c3 100755 --- a/maps/bin/processaction.cgi +++ b/maps/bin/processaction.cgi @@ -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 [ diff --git a/maps/lib/MAPS.pm b/maps/lib/MAPS.pm index 8a764cf..618fb67 100644 --- a/maps/lib/MAPS.pm +++ b/maps/lib/MAPS.pm @@ -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}; -- 2.17.1