Ver código fonte

refactor(notifications): rename HandleIncomingMessage to Notify

ayn2op 9 meses atrás
pai
commit
bca733a352
3 arquivos alterados com 2 adições e 4 exclusões
  1. 1 1
      cmd/state.go
  2. 0 2
      go.sum
  3. 1 1
      internal/notifications/notifications.go

+ 1 - 1
cmd/state.go

@@ -165,7 +165,7 @@ func onMessageCreate(message *gateway.MessageCreateEvent) {
 		app.Draw()
 	}
 
-	if err := notifications.HandleIncomingMessage(discordState, message, app.cfg); err != nil {
+	if err := notifications.Notify(discordState, message, app.cfg); err != nil {
 		slog.Error("Notification failed", "err", err)
 	}
 }

+ 0 - 2
go.sum

@@ -166,8 +166,6 @@ github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+a
 github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg=
 github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY=
-github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
 github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA=
 github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
 github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8ua9s=

+ 1 - 1
internal/notifications/notifications.go

@@ -15,7 +15,7 @@ import (
 	"github.com/diamondburned/ningen/v3"
 )
 
-func HandleIncomingMessage(state *ningen.State, msg *gateway.MessageCreateEvent, cfg *config.Config) error {
+func Notify(state *ningen.State, msg *gateway.MessageCreateEvent, cfg *config.Config) error {
 	// Only display notification if enabled and unmuted
 	if !cfg.Notifications.Enabled || state.MessageMentions(&msg.Message) == 0 || cfg.Status == discord.DoNotDisturbStatus {
 		return nil