5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-24 20:11:36 +00:00

Handle messages with link preview not being relayed (whatsapp) (#1970)

Resolves #1840
This commit is contained in:
Joseph Mansy 2023-03-09 12:46:57 -08:00 committed by GitHub
parent 57ce19150f
commit ac681687f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,10 @@ func (b *Bwhatsapp) handleTextMessage(messageInfo types.MessageInfo, msg *proto.
// nolint:nestif // nolint:nestif
if msg.GetExtendedTextMessage() == nil { if msg.GetExtendedTextMessage() == nil {
text = msg.GetConversation() 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 { } else {
text = msg.GetExtendedTextMessage().GetText() text = msg.GetExtendedTextMessage().GetText()
ci := msg.GetExtendedTextMessage().GetContextInfo() ci := msg.GetExtendedTextMessage().GetContextInfo()