diff --git a/scripts/alertmailer.php b/scripts/alertmailer.php index 03faba7b63..7766461c92 100644 --- a/scripts/alertmailer.php +++ b/scripts/alertmailer.php @@ -195,6 +195,7 @@ function mlog($message) { continue; } $criteria_raw = $alertitem['criteria']; + $include_votes = $alertitem['ignore_speaker_votes'] == 0; if (preg_match('#\bOR\b#', $criteria_raw)) { $criteria_raw = "($criteria_raw)"; } @@ -249,7 +250,7 @@ function mlog($message) { mlog(", hits " . $total_results . ", time " . (getmicrotime() - $start) . "\n"); # Divisions - if (preg_match('#^speaker:(\d+)$#', $criteria_raw, $m)) { + if ($include_votes && preg_match('#^speaker:(\d+)$#', $criteria_raw, $m)) { $pid = $m[1]; $q = $db->query('SELECT * FROM persondivisionvotes pdv JOIN divisions USING(division_id) WHERE person_id=:person_id AND pdv.lastupdate >= :time', [ diff --git a/www/includes/easyparliament/alert.php b/www/includes/easyparliament/alert.php index 226b6991e6..54f99adc61 100644 --- a/www/includes/easyparliament/alert.php +++ b/www/includes/easyparliament/alert.php @@ -90,6 +90,7 @@ public function fetch($confirmed, $deleted) { criteria, registrationtoken, lang, + ignore_speaker_votes, deleted, confirmed FROM alerts