Respond with status only if there is some content inside message

This commit is contained in:
2021-09-17 18:18:51 +02:00
parent ac8e0473e3
commit 69b8282880

View File

@@ -188,6 +188,11 @@ func handleMessage(s xmpp.Sender, p stanza.Packet) {
return
}
if len(msg.Body) == 0 {
log.Printf("<%v> received empty message, and will not respond", msg.To)
return
}
log.Printf("<%v> received following message: %v", msg.To, msg.Body)
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.StatusMessageDelay))
log.Printf("DELAYING FOR: %v", statusMesageDelay*1000000000)