Correctly log cases where getMessageIntent returns nil

This commit is contained in:
Tulir Asokan 2020-11-17 02:16:32 +02:00
parent 7d54aca762
commit 83779c6970

View File

@ -347,9 +347,14 @@ func (portal *Portal) startHandling(source *User, info whatsapp.MessageInfo) *ap
} else if portal.isDuplicate(info.Id) { } else if portal.isDuplicate(info.Id) {
portal.log.Debugfln("Not handling %s: message is duplicate", info.Id) portal.log.Debugfln("Not handling %s: message is duplicate", info.Id)
} else { } else {
portal.log.Debugfln("Starting handling of %s (ts: %d)", info.Id, info.Timestamp)
portal.lastMessageTs = 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 return nil
} }