mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 05:34:48 +02:00
ClusterEvents: Sync & process notification notified_problem_users
This commit is contained in:
parent
8714f72d65
commit
66cc6a4d8a
@ -1281,6 +1281,7 @@ void ClusterEvents::NotificationSentToAllUsersHandler(const Notification::Ptr& n
|
|||||||
params->Set("notification_number", notification->GetNotificationNumber());
|
params->Set("notification_number", notification->GetNotificationNumber());
|
||||||
params->Set("last_problem_notification", notification->GetLastProblemNotification());
|
params->Set("last_problem_notification", notification->GetLastProblemNotification());
|
||||||
params->Set("no_more_notifications", notification->GetNoMoreNotifications());
|
params->Set("no_more_notifications", notification->GetNoMoreNotifications());
|
||||||
|
params->Set("notified_problem_users", notification->GetNotifiedProblemUsers());
|
||||||
|
|
||||||
Dictionary::Ptr message = new Dictionary();
|
Dictionary::Ptr message = new Dictionary();
|
||||||
message->Set("jsonrpc", "2.0");
|
message->Set("jsonrpc", "2.0");
|
||||||
@ -1373,12 +1374,16 @@ Value ClusterEvents::NotificationSentToAllUsersAPIHandler(const MessageOrigin::P
|
|||||||
notification->SetLastProblemNotification(params->Get("last_problem_notification"));
|
notification->SetLastProblemNotification(params->Get("last_problem_notification"));
|
||||||
notification->SetNoMoreNotifications(params->Get("no_more_notifications"));
|
notification->SetNoMoreNotifications(params->Get("no_more_notifications"));
|
||||||
|
|
||||||
ArrayData notifiedProblemUsers;
|
if (params->Contains("notified_problem_users")) {
|
||||||
for (const User::Ptr& user : users) {
|
notification->SetNotifiedProblemUsers(params->Get("notified_problem_users"));
|
||||||
notifiedProblemUsers.push_back(user->GetName());
|
} else {
|
||||||
}
|
ArrayData notifiedProblemUsers;
|
||||||
|
for (const User::Ptr& user : users) {
|
||||||
|
notifiedProblemUsers.push_back(user->GetName());
|
||||||
|
}
|
||||||
|
|
||||||
notification->SetNotifiedProblemUsers(new Array(std::move(notifiedProblemUsers)));
|
notification->SetNotifiedProblemUsers(new Array(std::move(notifiedProblemUsers)));
|
||||||
|
}
|
||||||
|
|
||||||
Checkable::OnNotificationSentToAllUsers(notification, checkable, users, type, cr, author, text, origin);
|
Checkable::OnNotificationSentToAllUsers(notification, checkable, users, type, cr, author, text, origin);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user