Desktop notifications can now be disabled
MODIFY
internal/config/config.go
internal/config/config.go
@@ -48,6 +48,7 @@ var (
OnTypeInListBehaviour: SearchOnTypeInList,
ShortenLinks: false,
ShortenerPort: 51726,
+ DesktopNotifications: true,
}
)
@@ -93,6 +94,10 @@ type Config struct {
// ShortenerPort defines the port, that the webserver for the linkshortener
// will be using.
ShortenerPort int
+
+ // DesktopNotifications decides wether a popup will be shown in the users
+ // system when a notification needs to be sent.
+ DesktopNotifications bool
}
var cachedConfigDir string

MODIFY
internal/ui/window.go
internal/ui/window.go
@@ -664,6 +664,7 @@ func NewWindow(app *tview.Application, discord *discordgo.Session) (*Window, err
}
}
+ if config.GetConfig().DesktopNotifications {
channel, stateError := window.session.State.Channel(message.ChannelID)
if stateError == nil {
if !mentionsYou {
@@ -698,6 +699,7 @@ func NewWindow(app *tview.Application, discord *discordgo.Session) (*Window, err
beeep.Notify("Cordless - "+notificationLocation, message.ContentWithMentionsReplaced(), "assets/information.png")
}
}
+ }
window.app.QueueUpdateDraw(func() {
window.channelRootNode.Walk(func(node, parent *tview.TreeNode) bool {

Desktop notifications can now be disabled