dont send a message if entry is empty - Fixes #7
This commit is contained in:
4
main.go
4
main.go
@@ -365,7 +365,7 @@ func main() {
|
|||||||
chatTabs[mucJidStr].Muc = muc
|
chatTabs[mucJidStr].Muc = muc
|
||||||
str := *msg.CleanedBody
|
str := *msg.CleanedBody
|
||||||
if !ignore && notifications {
|
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))
|
a.SendNotification(fyne.NewNotification(fmt.Sprintf("Mentioned in %s", mucJidStr), str))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -514,7 +514,7 @@ func main() {
|
|||||||
|
|
||||||
SendCallback := func() {
|
SendCallback := func() {
|
||||||
text := entry.Text
|
text := entry.Text
|
||||||
if tabs.Selected() == nil || tabs.Selected().Content == nil {
|
if tabs.Selected() == nil || tabs.Selected().Content == nil || text == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user