MCPcopy Create free account
hub / github.com/Icinga/icinga2 / SendNotificationUsersChanged

Method SendNotificationUsersChanged

lib/icingadb/icingadb-objects.cpp:2634–2648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2632}
2633
2634void IcingaDB::SendNotificationUsersChanged(const Notification::Ptr& notification, const Array::Ptr& oldValues, const Array::Ptr& newValues) {
2635 if (!m_RconWorker || !m_RconWorker->IsConnected() || oldValues == newValues) {
2636 return;
2637 }
2638
2639 std::vector<Value> deletedUsers = GetArrayDeletedValues(oldValues, newValues);
2640
2641 for (const auto& userName : deletedUsers) {
2642 String id = HashValue(new Array({m_EnvironmentId, "user", userName, notification->GetName()}));
2643 EnqueueRelationsDeletion(id,{
2644 {CONFIG_REDIS_KEY_PREFIX "notification:user", ""},
2645 {CONFIG_REDIS_KEY_PREFIX "notification:recipient", ""},
2646 });
2647 }
2648}
2649
2650void IcingaDB::SendNotificationUserGroupsChanged(const Notification::Ptr& notification, const Array::Ptr& oldValues, const Array::Ptr& newValues) {
2651 if (!m_RconWorker || !m_RconWorker->IsConnected() || oldValues == newValues) {

Callers 1

Calls 2

IsConnectedMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected