From 181b91edb4a4ec33ceb57709b391d58793f1ecff Mon Sep 17 00:00:00 2001 From: sunglocto Date: Wed, 6 Aug 2025 21:59:49 +0100 Subject: [PATCH] dont send a message if entry is empty - Fixes #7 --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 47743c3..b8b9b2f 100644 --- a/main.go +++ b/main.go @@ -365,7 +365,7 @@ func main() { chatTabs[mucJidStr].Muc = muc str := *msg.CleanedBody if !ignore && notifications { - if !correction && strings.Contains(str, login.DisplayName) || (msg.Reply != nil && strings.Contains(msg.Reply.To, login.DisplayName)) { + 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)) } } @@ -514,7 +514,7 @@ func main() { SendCallback := func() { text := entry.Text - if tabs.Selected() == nil || tabs.Selected().Content == nil { + if tabs.Selected() == nil || tabs.Selected().Content == nil || text == "" { return }