Merge pull request #9001 from Icinga/feature/icingadb-add-user-ids-to-notification-history

Icinga DB: Write IDs of notified users into notification history stream
This commit is contained in:
Alexander Aleksandrovič Klimov 2021-10-01 17:42:48 +02:00 committed by GitHub
commit ed50a9d529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -1675,6 +1675,15 @@ void IcingaDB::SendSentNotification(
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
if (!users.empty()) {
Array::Ptr users_notified = new Array();
for (const User::Ptr& user : users) {
users_notified->Add(GetObjectIdentifier(user));
}
xAdd.emplace_back("users_notified_ids");
xAdd.emplace_back(JsonEncode(users_notified));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History);
for (const User::Ptr& user : users) {