Only send acknowledgement notification if user received a problem notification

refs #6047
This commit is contained in:
Noah Hilverling 2018-08-07 10:02:13 +02:00 committed by Michael Friedrich
parent 0ef6084d1c
commit bfe7d46a68
1 changed files with 9 additions and 0 deletions

View File

@ -409,6 +409,15 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
} }
} }
/* on acknowledgement, check if user was notified before */
if (type == NotificationAcknowledgement) {
if (!notifiedProblemUsers->Contains(userName)) {
Log(LogNotice, "Notification")
<< "We did not notify user '" << userName << "' for a problem before. Not sending acknowledgement notification.";
continue;
}
}
Log(LogInformation, "Notification") Log(LogInformation, "Notification")
<< "Sending " << (reminder ? "reminder " : "") << "'" << NotificationTypeToStringInternal(type) << "' notification '" << "Sending " << (reminder ? "reminder " : "") << "'" << NotificationTypeToStringInternal(type) << "' notification '"
<< GetName() << "' for user '" << userName << "'"; << GetName() << "' for user '" << userName << "'";