Respond with status only if there is some content inside message
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user