Commit 83779c69 authored by Tulir Asokan's avatar Tulir Asokan 🐈

Correctly log cases where getMessageIntent returns nil

parent 7d54aca7
Pipeline #1828 passed with stages
in 1 minute and 21 seconds
......@@ -347,9 +347,14 @@ func (portal *Portal) startHandling(source *User, info whatsapp.MessageInfo) *ap
} else if portal.isDuplicate(info.Id) {
portal.log.Debugfln("Not handling %s: message is duplicate", info.Id)
} else {
portal.log.Debugfln("Starting handling of %s (ts: %d)", info.Id, info.Timestamp)
portal.lastMessageTs = info.Timestamp
return portal.getMessageIntent(source, info)
intent := portal.getMessageIntent(source, info)
if intent != nil {
portal.log.Debugfln("Starting handling of %s (ts: %d)", info.Id, info.Timestamp)
} else {
portal.log.Debugfln("Not handling %s: sender is not known")
}
return intent
}
return nil
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment