#################################################################################
#
# File: $RCSfile: MAPSDB.pm,v $
-# Revision: $Revision: 1.1 $
+# Revision: $Revision: 1.1 $
# Description: MAPS Database routines
# Author: Andrew@DeFaria.com
# Created: Fri Nov 29 14:17:21 2002
return;
} # RecordHit
-sub CheckOnList ($$) {
+sub CheckOnList ($$;$) {
# CheckOnList will check to see if the $sender is on the $listfile.
# Return 1 if found 0 if not.
- my ($listtype, $sender) = @_;
+ my ($listtype, $sender, $update) = @_;
- my $status = 0;
- my $rule;
+ $update //= 1;
+
+ my $status = 0;
+ my ($rule, $sequence, $hit_count);
my $statement = "select pattern, domain, comment, sequence, hit_count from list where userid = '$userid' and type = '$listtype'";
while (my @row = $sth->fetchrow_array) {
last if !@row;
- my $hit_count = pop (@row);
- my $sequence = pop (@row);
+ $hit_count = pop (@row);
+ $sequence = pop (@row);
my $comment = pop (@row);
my $domain = pop (@row);
my $pattern = pop (@row);
$rule .= " - $comment" if $comment and $comment ne '';
$status = 1;
- RecordHit $listtype, $sequence, ++$hit_count;
+ RecordHit $listtype, $sequence, ++$hit_count if $update;
last;
} # if
$sth->finish;
- return ($status, $rule);
+ return ($status, $rule, $sequence, $hit_count);
} # CheckOnList
sub CleanEmail ($) {