| 2648 | } |
| 2649 | |
| 2650 | void IcingaDB::SendNotificationUserGroupsChanged(const Notification::Ptr& notification, const Array::Ptr& oldValues, const Array::Ptr& newValues) { |
| 2651 | if (!m_RconWorker || !m_RconWorker->IsConnected() || oldValues == newValues) { |
| 2652 | return; |
| 2653 | } |
| 2654 | |
| 2655 | std::vector<Value> deletedUserGroups = GetArrayDeletedValues(oldValues, newValues); |
| 2656 | |
| 2657 | for (const auto& userGroupName : deletedUserGroups) { |
| 2658 | UserGroup::Ptr userGroup = UserGroup::GetByName(userGroupName); |
| 2659 | String id = HashValue(new Array({m_EnvironmentId, "usergroup", userGroupName, notification->GetName()})); |
| 2660 | EnqueueRelationsDeletion(id, { |
| 2661 | {CONFIG_REDIS_KEY_PREFIX "notification:usergroup", ""}, |
| 2662 | {CONFIG_REDIS_KEY_PREFIX "notification:recipient", ""} |
| 2663 | }); |
| 2664 | |
| 2665 | for (const User::Ptr& user : userGroup->GetMembers()) { |
| 2666 | String userId = HashValue(new Array({m_EnvironmentId, "usergroupuser", user->GetName(), userGroupName, notification->GetName()})); |
| 2667 | EnqueueRelationsDeletion(userId, {{CONFIG_REDIS_KEY_PREFIX "notification:recipient", ""}}); |
| 2668 | } |
| 2669 | } |
| 2670 | } |
| 2671 | |
| 2672 | void IcingaDB::SendTimePeriodRangesChanged(const TimePeriod::Ptr& timeperiod, const Dictionary::Ptr& oldValues, const Dictionary::Ptr& newValues) { |
| 2673 | if (!m_RconWorker || !m_RconWorker->IsConnected() || oldValues == newValues) { |
no test coverage detected