Description: fix broken alert edgetrigger functionality
Author: Gerald Turner <gturner@unzane.com>
Origin: Debian BTS
Bug-Debian: https://bugs.debian.org/934170
Applied-Upstream: https://github.com/oetiker/SmokePing/commit/e9004e8bbeb30d33778afaf70a5f8b95ff38d6ba
Reviewed-By: Matteo F. Vescovi <mfv@debian.org>
Last-Update: 2020-07-06

diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 71a895d..82ef6e5 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1879,7 +1879,7 @@ sub check_alerts {
                 $gotalert = $match unless $gotalert;
             my $edgetrigger = $alert->{edgetrigger} eq 'yes';
             my $what;
-            if ($edgetrigger and $prevmatch != $match) {
+            if ($edgetrigger and ($prevmatch ? 0 : 1 ) != ($match ? 0 : 1)) {
                 $what = ($prevmatch == 0 ? "was raised" : "was cleared");
             }
             if (not $edgetrigger and $match) {
