Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: event message_ciphertext #2292

Merged
merged 28 commits into from
Dec 16, 2023
Merged

feat: event message_ciphertext #2292

merged 28 commits into from
Dec 16, 2023

Conversation

tofers
Copy link
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
src/util/Constants.js Outdated Show resolved Hide resolved
@tofers tofers changed the title feat: option cipher feat: event message_ciphertext Jun 27, 2023
@CJRMedeiros123
Copy link

Not work for me =(

@tofers
Copy link
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
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
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
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 pedroslopez#2292 in the original repo.

Reference: pedroslopez#2292
Copy link

@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
Collaborator

alechkos commented Dec 3, 2023

@tofers
Please add

* @fires Client#message_ciphertext

after this line in Client.js

@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
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet