From ac681687f8afe770edbae439e08d49b472517fc6 Mon Sep 17 00:00:00 2001 From: Joseph Mansy <36427684+yousefmansy1@users.noreply.github.com> Date: Thu, 9 Mar 2023 12:46:57 -0800 Subject: Handle messages with link preview not being relayed (whatsapp) (#1970) Resolves #1840 --- bridge/whatsappmulti/handlers.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bridge') diff --git a/bridge/whatsappmulti/handlers.go b/bridge/whatsappmulti/handlers.go index 34dce471..95fe8232 100644 --- a/bridge/whatsappmulti/handlers.go +++ b/bridge/whatsappmulti/handlers.go @@ -63,6 +63,10 @@ func (b *Bwhatsapp) handleTextMessage(messageInfo types.MessageInfo, msg *proto. // nolint:nestif if msg.GetExtendedTextMessage() == nil { text = msg.GetConversation() + } else if msg.GetExtendedTextMessage().GetContextInfo() == nil { + // Handle pure text message with a link preview + // A pure text message with a link preview acts as an extended text message but will not contain any context info + text = msg.GetExtendedTextMessage().GetText() } else { text = msg.GetExtendedTextMessage().GetText() ci := msg.GetExtendedTextMessage().GetContextInfo() -- cgit v1.2.3