forked from sunglocto/pi-im
Use better notification lib
This commit is contained in:
11
main.go
11
main.go
@@ -31,6 +31,7 @@ import (
|
||||
"github.com/makeworld-the-better-one/go-isemoji"
|
||||
"github.com/rrivera/identicon"
|
||||
"github.com/shreve/musicwand/pkg/mpris"
|
||||
"github.com/gen2brain/beeep"
|
||||
|
||||
// xmpp - required
|
||||
oasisSdk "github.com/sunglocto/oasis-sdk"
|
||||
@@ -445,7 +446,9 @@ func dropToSignInPage(reason string) {
|
||||
dialog.ShowError(err, w)
|
||||
return
|
||||
}
|
||||
a.SendNotification(fyne.NewNotification("Done", "Relaunch the application"))
|
||||
// a.SendNotification(fyne.NewNotification("Done", "Relaunch the application"))
|
||||
beeep.Notify("Done", "Relaunch the application", iconBytes)
|
||||
|
||||
a.Quit()
|
||||
//w.Close()
|
||||
}
|
||||
@@ -504,7 +507,8 @@ func main() {
|
||||
if ok {
|
||||
str := *msg.CleanedBody
|
||||
if notifications {
|
||||
a.SendNotification(fyne.NewNotification(fmt.Sprintf("%s says", userJidStr), str))
|
||||
// a.SendNotification(fyne.NewNotification(fmt.Sprintf("%s says", userJidStr), str))
|
||||
beeep.Notify("Direct message", fmt.Sprintf("%s says:\n%s", userJidStr, str), iconBytes)
|
||||
}
|
||||
|
||||
for _, v := range msg.Unknown {
|
||||
@@ -610,7 +614,8 @@ func main() {
|
||||
}
|
||||
if !donotnotify && !ignore && notifications {
|
||||
if !correction && msg.From.String() != client.JID.String() && strings.Contains(str, login.DisplayName) || (msg.Reply != nil && strings.Contains(msg.Reply.To, login.DisplayName)) {
|
||||
a.SendNotification(fyne.NewNotification(fmt.Sprintf("Mentioned in %s", mucJidStr), str))
|
||||
// a.SendNotification(fyne.NewNotification(fmt.Sprintf("Mentioned in %s", mucJidStr), str))
|
||||
beeep.Notify(fmt.Sprintf("Mentioned in %s by %s", mucJidStr, msg.From.Resourcepart()), str, iconBytes)
|
||||
}
|
||||
}
|
||||
if strings.Contains(str, "https://") {
|
||||
|
||||
Reference in New Issue
Block a user