From 5f95b72744af0aa88aa57cf30e582801b5a9c815 Mon Sep 17 00:00:00 2001 From: Hunter Long Date: Thu, 1 Nov 2018 16:26:25 +0100 Subject: [PATCH] notifications --- core/notifier/notifiers.go | 4 ++-- notifiers/mobile.go | 2 +- notifiers/mobile_test.go | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/core/notifier/notifiers.go b/core/notifier/notifiers.go index e9341b91..4f510f12 100644 --- a/core/notifier/notifiers.go +++ b/core/notifier/notifiers.go @@ -278,11 +278,11 @@ CheckNotifier: ok, _ := notification.WithinLimits() if ok { msg := notification.Queue[0] - err := n.Send(msg) + err := n.Send(msg.Data) if err != nil { utils.Log(2, fmt.Sprintf("notifier %v had an error: %v", notification.Method, err)) } - notification.makeLog(msg) + notification.makeLog(msg.Data) notification.Queue = notification.Queue[1:] rateLimit = notification.Delay } diff --git a/notifiers/mobile.go b/notifiers/mobile.go index 8ccf7abb..363eac73 100644 --- a/notifiers/mobile.go +++ b/notifiers/mobile.go @@ -100,7 +100,7 @@ func (u *mobilePush) OnTest() error { return nil } -// Send will send a HTTP Post to the discord API. It accepts type: []byte +// Send will send message to expo mobile push notifications endpoint func (u *mobilePush) Send(msg interface{}) error { pushMessage := msg.(*expo.PushMessage) client := expo.NewPushClient(nil) diff --git a/notifiers/mobile_test.go b/notifiers/mobile_test.go index 7d036940..009806a0 100644 --- a/notifiers/mobile_test.go +++ b/notifiers/mobile_test.go @@ -106,12 +106,6 @@ func TestMobileNotifier(t *testing.T) { assert.True(t, ok) }) - t.Run("mobile Send", func(t *testing.T) { - err := mobile.Send(slackTestMessage) - assert.Nil(t, err) - assert.Equal(t, 0, len(mobile.Queue)) - }) - t.Run("mobile Test", func(t *testing.T) { err := mobile.OnTest() assert.Nil(t, err)