pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.17k stars 3.62k forks source link

fix: sendMessage with quoted message id #3260

Closed alwinlubbers closed 2 weeks ago

alwinlubbers commented 1 month ago

Now using window.Store.Msg.getMessagesById instead of window.Store.Msg.get

PR Details

This PR fixes the exception that was thrown when using client.sendMessage() with a quotedMessageId in the MessageSendOptions parameter.

Description

It seemed like window.Store.get() couldn't get a message, even with a valid serialized chat message id.

The window.Store.Msg.getMessagesById function was taken from here: https://github.com/pedroslopez/whatsapp-web.js/blob/066d8fa75ebc13b9cc74cfcd18ffd847b79be998/src/Client.js#L1039

Related Issue

closes #3259

Motivation and Context

This will solve the problem of being unable to send messages with a quote attached.

How Has This Been Tested

I've tested this version with my local Node.js install (system/os details can be found in the mentioned issue).

I've tried sending a couple of messages in private and group chats. With both messages from me and others. It has also been tested on a clean install (without auth).

Types of changes

Checklist

arturhc commented 2 weeks ago

Hi there! Just checking in, do you have any idea when this PR might be merged?

shirser121 commented 2 weeks ago

@alechkos @tuyuribr @tuyuribr3 you should approve this