Skip to content

Commit

Permalink
Update Online Message for Line-Notify Notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
l0nax committed Oct 4, 2019
1 parent df3eb91 commit a9b5592
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion notifiers/line_notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package notifiers
import (
"fmt"
"github.com/hunterlong/statping/core/notifier"
"github.com/hunterlong/statping/core"
"github.com/hunterlong/statping/types"
"github.com/hunterlong/statping/utils"
"net/url"
Expand Down Expand Up @@ -79,8 +80,14 @@ func (u *lineNotifier) OnFailure(s *types.Service, f *types.Failure) {
// OnSuccess will trigger successful service
func (u *lineNotifier) OnSuccess(s *types.Service) {
if !s.Online {
var msg string
if core.CoreApp.UpdateNotify.Bool {
msg = core.ReturnService(s).SmallText()
} else {
msg = fmt.Sprintf("Your Service %v is Back Online", s.Name)
}

u.ResetUniqueQueue(fmt.Sprintf("service_%v", s.Id))
msg := fmt.Sprintf("Your service '%v' is back online!", s.Name)
u.AddQueue(fmt.Sprintf("service_%v", s.Id), msg)
}
}
Expand Down

0 comments on commit a9b5592

Please sign in to comment.