X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Flib%2FMAPS.pm;h=618fb67ed0ca9ecd5cbffc3fcdfb6e417c7442d0;hb=f6c2a9114dff9bf8882180bbf49ed6b3e3533a91;hp=d63f9b9e4ad62b5d3d3b7fa7176f3bc201695440;hpb=9a7e8178524ea77a12d2793791b9630017e1cbe8;p=clearscm.git diff --git a/maps/lib/MAPS.pm b/maps/lib/MAPS.pm index d63f9b9..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}; @@ -544,6 +544,8 @@ sub CleanList(%) { return 0 unless $count; + $count = 0; + my ($err, $errmsg) = $db->find($table, $condition); croak "Unable to find $params{type} entries for $condition - $errmsg" if $err; @@ -1011,7 +1013,7 @@ sub ResequenceList(%) { $db->lock('write', $table); # Get all records for $userid and $type - my $listrecs = $db->get($table, $condition); + my $listrecs = $db->get($table, $condition,'*', 'order by hit_count desc'); # Delete all of the list entries for this $userid and $type my ($count, $msg) = $db->delete($table, $condition);