From 83779c6970fd6d597d7775999624274995265ac2 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 17 Nov 2020 02:16:32 +0200 Subject: [PATCH] Correctly log cases where getMessageIntent returns nil --- portal.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/portal.go b/portal.go index ebaad83..3b225f9 100644 --- a/portal.go +++ b/portal.go @@ -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 }