]> granicus.if.org Git - icinga2/commitdiff
Only check for Problem types in user filers for Recovery/Acknowledgement notifications
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 12 Sep 2018 15:04:11 +0000 (17:04 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 12 Sep 2018 15:09:15 +0000 (17:09 +0200)
refs #6047

lib/icinga/notification.cpp

index 6da7f428fd3730d5d80286ec5aead115453728f2..9ac006e1e77b5905e50de32dcf9e1ae1427afafa 100644 (file)
@@ -402,18 +402,20 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
                /* on recovery, check if user was notified before */
                if (type == NotificationRecovery) {
-                       if (!notifiedProblemUsers->Contains(userName) && CheckNotificationUserFilters(NotificationProblem, user, false, false)) {
+                       if (!notifiedProblemUsers->Contains(userName) && (NotificationProblem & user->GetTypeFilter())) {
                                Log(LogNotice, "Notification")
-                                       << "We did not notify user '" << userName << "' for a problem before. Not sending recovery notification.";
+                                       << "We did not notify user '" << userName
+                                       << "' (Problem types enabled) for a problem before. Not sending recovery notification.";
                                continue;
                        }
                }
 
                /* on acknowledgement, check if user was notified before */
                if (type == NotificationAcknowledgement) {
-                       if (!notifiedProblemUsers->Contains(userName) && CheckNotificationUserFilters(NotificationProblem, user, false, false)) {
+                       if (!notifiedProblemUsers->Contains(userName) && (NotificationProblem & user->GetTypeFilter())) {
                                Log(LogNotice, "Notification")
-                                               << "We did not notify user '" << userName << "' for a problem before. Not sending acknowledgement notification.";
+                                       << "We did not notify user '" << userName
+                                       << "' (Problem types enabled) for a problem before. Not sending acknowledgement notification.";
                                continue;
                        }
                }