| 612 | } |
| 613 | |
| 614 | Value ClusterEvents::LastNotifiedStatePerUserClearedAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params) |
| 615 | { |
| 616 | auto endpoint (origin->FromClient->GetEndpoint()); |
| 617 | |
| 618 | if (!endpoint) { |
| 619 | Log(LogNotice, "ClusterEvents") |
| 620 | << "Discarding 'last notified state of user cleared' message from '" |
| 621 | << origin->FromClient->GetIdentity() << "': Invalid endpoint origin (client not allowed)."; |
| 622 | |
| 623 | return Empty; |
| 624 | } |
| 625 | |
| 626 | if (origin->FromZone && origin->FromZone != Zone::GetLocalZone()) { |
| 627 | Log(LogNotice, "ClusterEvents") |
| 628 | << "Discarding 'last notified state of user cleared' message from '" |
| 629 | << origin->FromClient->GetIdentity() << "': Unauthorized access."; |
| 630 | |
| 631 | return Empty; |
| 632 | } |
| 633 | |
| 634 | auto notification (Notification::GetByName(params->Get("notification"))); |
| 635 | |
| 636 | if (!notification) { |
| 637 | return Empty; |
| 638 | } |
| 639 | |
| 640 | notification->GetLastNotifiedStatePerUser()->Clear(); |
| 641 | Notification::OnLastNotifiedStatePerUserCleared(notification, origin); |
| 642 | |
| 643 | return Empty; |
| 644 | } |
| 645 | |
| 646 | void ClusterEvents::ForceNextCheckChangedHandler(const Checkable::Ptr& checkable, const MessageOrigin::Ptr& origin) |
| 647 | { |
nothing calls this directly
no test coverage detected