From: Gunnar Beutner Date: Fri, 30 Aug 2013 13:56:03 +0000 (+0200) Subject: Fix 'force' parameter for notifications. X-Git-Tag: v0.0.3~637 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4f5ff90b610422fa19cce36770e808edaebd949;p=icinga2 Fix 'force' parameter for notifications. --- diff --git a/lib/icinga/service-notification.cpp b/lib/icinga/service-notification.cpp index ba97c02ea..0ad7a2bed 100644 --- a/lib/icinga/service-notification.cpp +++ b/lib/icinga/service-notification.cpp @@ -48,15 +48,14 @@ void Service::ResetNotificationNumbers(void) void Service::SendNotifications(NotificationType type, const Dictionary::Ptr& cr, const String& author, const String& text) { - bool force = false; + bool force = GetForceNextNotification(); if (!GetEnableNotifications()) { - if (!GetForceNextNotification()) { + if (!force) { Log(LogInformation, "icinga", "Notifications are disabled for service '" + GetName() + "'."); return; } - force = true; SetForceNextNotification(false); }