Skip to content

feat: event message_ciphertext#2292

Merged
aliyss merged 28 commits into
wwebjs:mainfrom
tofers:option-cipher
Dec 16, 2023
Merged

feat: event message_ciphertext#2292
aliyss merged 28 commits into
wwebjs:mainfrom
tofers:option-cipher

Conversation

@tofers
Copy link
Copy Markdown
Contributor

@tofers tofers commented Jun 21, 2023

PR Details

Receive protected message events

Description.

Sometimes Whatsapp can't decrypt messages when people are texting for the first time or for another reason.

Related Question

closes #1041, closes #1337, closes #1921, closes #2405, closes #2410

Motivation and context.

It's important for me to get the fact of such messages and notify the customer.

How this has been tested

Linux, Centos OS

Types of changes

  • Dependency changes
  • Bug fix (non-breaking change that fixes the problem)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that will change existing functionality)

Checklist

  • My code matches the code style of this project.
  • I have updated the documentation accordingly (index.d.ts).

@tofers tofers changed the title Option cipher feat: option cipher Jun 21, 2023
Comment thread src/util/Constants.js Outdated
@tofers tofers changed the title feat: option cipher feat: event message_ciphertext Jun 27, 2023
@CJRMedeiros123
Copy link
Copy Markdown

Not work for me =(

@tofers
Copy link
Copy Markdown
Contributor Author

tofers commented Jul 3, 2023

I tested it on clients who didn't get the first message. And it works. As discussed above, the message is sometimes decrypted.

10:06:59 cipher text
10:07:00 message original text

If you will be subscribing to an event you should do a handling on the decrypted message.

This is important to me. Since several clients are gone... :-(

@seowzhenjun0126
Copy link
Copy Markdown
Contributor

Hi @tofers , I saw that you added the "message_ciphertext" event, but it doesn't help decrypting the mssage right? How do you decrypt the mssage? I also have a few clients facing the same issue

@tofers
Copy link
Copy Markdown
Contributor Author

tofers commented Jul 7, 2023

@seowzhenjun0126 Hi. There is no way to decipher this message yet.

I now recommend that customers switch to Business Whatsapp. But the problem there is also relevant.

This is due to the lack of trust in Whatsapp. When there is a large flow of incoming messages or a new account. I have not traced the regularities.

But the fact that a message came from a client is sometimes enough to create a new contact \ lead \ transaction and send a greeting to the client

@seowzhenjun0126
Copy link
Copy Markdown
Contributor

@tofers Thanks for the reply. But this is so frustrating as I needed the body of the message for the bot to reply relevant message, and I don't see a way to solve this issue.

seowzhenjun0126 added a commit to seowzhenjun0126/whatsapp-web.js that referenced this pull request Jul 11, 2023
This is a manual replication of pull request wwebjs#2292 in the original repo.

Reference: wwebjs#2292
Copy link
Copy Markdown

@MemmoX MemmoX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this solution and worked for me

@alechkos
Copy link
Copy Markdown
Contributor

alechkos commented Dec 3, 2023

@tofers
Please add

* @fires Client#message_ciphertext

after this line in Client.js

@alechkos alechkos requested a review from shirser121 December 5, 2023 12:38
@alechkos alechkos enabled auto-merge (squash) December 12, 2023 21:43
@alechkos alechkos requested a review from aliyss December 13, 2023 15:42
@aliyss aliyss disabled auto-merge December 16, 2023 16:09
@aliyss aliyss enabled auto-merge (squash) December 16, 2023 16:10
Copy link
Copy Markdown
Collaborator

@aliyss aliyss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@aliyss aliyss merged commit 1dd35be into wwebjs:main Dec 16, 2023
@tofers tofers deleted the option-cipher branch February 11, 2024 06:35
Filarh pushed a commit to Filarh/whatsapp-web.js that referenced this pull request Jun 13, 2025
* add option cipherMsg

* add event  message_ciphertext

* example

* remove option cipherMsg

* removing unlinked code

* Update Client.js

---------

Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com>
Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
MarcelaMartinsRap added a commit to meetscrm/whatsapp-web.js that referenced this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet