Switch to new Service-Fields in events.go

pull/258/head
Emanuel Bennici 2019-10-04 17:24:28 +02:00
parent e1c41966e4
commit 2534078e11
No known key found for this signature in database
GPG Key ID: 17FA2D56BAD01661
1 changed files with 2 additions and 3 deletions

View File

@ -19,7 +19,6 @@ import (
"fmt"
"github.com/hunterlong/statping/types"
"github.com/hunterlong/statping/utils"
"github.com/hunterlong/statping/core"
)
// OnSave will trigger a notifier when it has been saved - Notifier interface
@ -41,7 +40,7 @@ func OnFailure(s *types.Service, f *types.Failure) {
}
// check if User wants to receive every Status Change
if core.CoreApp.UpdateNotify.Bool {
if s.UpdateNotify {
// send only if User hasn't been already notified about the Downtime
if !s.UserNotified {
s.UserNotified = true
@ -68,7 +67,7 @@ func OnSuccess(s *types.Service) {
}
// check if User wants to receive every Status Change
if core.CoreApp.UpdateNotify.Bool && s.UserNotified {
if s.UpdateNotify && s.UserNotified {
s.UserNotified = false
}