* Starts the component. */
| 34 | * Starts the component. |
| 35 | */ |
| 36 | void NotificationComponent::Start(bool runtimeCreated) |
| 37 | { |
| 38 | ObjectImpl<NotificationComponent>::Start(runtimeCreated); |
| 39 | |
| 40 | Log(LogInformation, "NotificationComponent") |
| 41 | << "'" << GetName() << "' started."; |
| 42 | |
| 43 | Checkable::OnNotificationsRequested.connect([this](const Checkable::Ptr& checkable, NotificationType type, const CheckResult::Ptr& cr, |
| 44 | const String& author, const String& text, const MessageOrigin::Ptr&) { |
| 45 | SendNotificationsHandler(checkable, type, cr, author, text); |
| 46 | }); |
| 47 | |
| 48 | m_NotificationTimer = Timer::Create(); |
| 49 | m_NotificationTimer->SetInterval(5); |
| 50 | m_NotificationTimer->OnTimerExpired.connect([this](const Timer * const&) { NotificationTimerHandler(); }); |
| 51 | m_NotificationTimer->Start(); |
| 52 | } |
| 53 | |
| 54 | void NotificationComponent::Stop(bool runtimeRemoved) |
| 55 | { |
nothing calls this directly
no test coverage detected