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

Fix incoming LID and sending LID #408

Merged
merged 26 commits into from
Dec 18, 2023
Merged

Fix incoming LID and sending LID #408

merged 26 commits into from
Dec 18, 2023

Conversation

PurpShell
Copy link
Collaborator

@PurpShell PurpShell commented Sep 30, 2023

Big thank you to @canove and @whaticket for the help and resources.

This should fix chats incoming/outgoing with people with a hidden number.

If you'd like to thank me for my work, I have a GitHub Sponsors

@whiskeysockets-bot
Copy link
Contributor

Thanks for your contribution.

The next step is to wait for review and approval to merge it to main repository

The community can help reacting with a thumb up (:thumbsup:) for approval and rocket (:rocket:) for who has tested it.

To test this PR you can run the following command below:

# NPM
npm install @whiskeysockets/baileys@WhiskeySockets/Baileys#fix-lids
# YARN v2
yarn add @whiskeysockets/baileys@WhiskeySockets/Baileys#fix-lids

@azudindaem
Copy link
Contributor

Has anyone tried it?

image

@takimtod
Copy link

takimtod commented Oct 1, 2023

Button support ?

Aduh sepuh bisa aja

@kyraex
Copy link
Contributor

kyraex commented Oct 4, 2023

Anyone using normal whatsapp in this PR? I tested with mine but it throws failed to decrypt message error. There are no error with the current release

{"level":50,"time":"2023-10-04T18:39:00.738Z","pid":1112926,"hostname":"server","key":{"remoteJid":"[email protected]","fromMe":true,"id":"DA49097B5759A7F01865526B4966515B"},"err":{"type":"PreKeyError","message":"Invalid PreKey ID","stack":"PreKeyError: Invalid PreKey ID\n at SessionBuilder.initIncoming (/root/app_server/0/node_modules/libsignal/src/session_builder.js:66:19)\n at async Object.XXXX.0 [as awaitable] (/root/app_server/0/node_modules/libsignal/src/session_cipher.js:205:30)\n at async _asyncQueueExecutor (/root/app_server/0/node_modules/libsignal/src/queue_job.js:20:29)","name":"PreKeyError"},"msg":"failed to decrypt message"}

@Salientekill
Copy link

I can't download this update ;-;

NPM

npm install @whiskeysockets/baileys@WhiskeySockets/Baileys#fix-lids

YARN v2

yarn add @whiskeysockets/baileys@WhiskeySockets/Baileys#fix-lids

Screenshot_2023-10-04-18-34-08-876_com server auditor ssh client-edit

@azudindaem
Copy link
Contributor

The masked number is from FB Ad Messages to WA Business. If you are using regular WhatsApp, this error is not related to this issue

@azudindaem
Copy link
Contributor

azudindaem commented Oct 6, 2023

Done a few testing on this PR.
Replicate test using actual FB Ads CTWA

Sending using @lid from Baileys to user - PASS
No more waiting for the message problem

RequestPhoneNumber - PASS
SharePhoneNumber - PASS

Receiving not appear in upsert event if user message - FAILED
Receiving not appear in upsert event after share number - FAILED

Test device -
WA Business 2.23.19.84

User 1: WA 2.23.20.74
User 2: WA Beta 2.23.21.7

Masked number only appear as privacy token

@PurpShell
Copy link
Collaborator Author

The masked number is from FB Ad Messages to WA Business. If you are using regular WhatsApp, this error is not related to this issue

in the future, we found traces that all businesses will talk to normal numbers through the LID. As a matter of fact, get a normal whatsapp lid right now, send a message to it through baileys in this PR through any business number. And you will not get their number, it'll be the same as the fb ads ctwa.

@PurpShell
Copy link
Collaborator Author

Also, I had no issues over dozens of numbers receiving and sending events and messages, check if anything is wrong with your configuration.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add lidJid as well in contacts.upsert here

            ev.emit('contacts.upsert', [{ id, name: action.contactAction!.fullName!, lidJid: action.contactAction!.lidJid! }])

Copy link
Collaborator Author

@PurpShell PurpShell Oct 10, 2023

Choose a reason for hiding this comment

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

no need, official whatsapp web launches a new conversation. it is up to you to change contact info or replace the chat id in your database.

@w3nder
Copy link
Contributor

w3nder commented Oct 10, 2023

So far, so good. I managed to capture the event from the ads and also respond to that contact.

@fogolin
Copy link

fogolin commented Nov 8, 2023

Any news on this? Can an Admin review this PR, we actually need one more review for this to be approved.

@azudindaem
Copy link
Contributor

@Auties00 we can approve this first then can be fixed later for user still not be able to detect conversion from lid

@w3nder
Copy link
Contributor

w3nder commented Nov 12, 2023

up

@jaison-x
Copy link

fresh installed test on "@whiskeysockets/baileys": "github:WhiskeySockets/Baileys#fix-lids"

Sending using @lid from Baileys to user - PASS No more waiting for the message problem

RequestPhoneNumber - PASS SharePhoneNumber - PASS

Receiving not appear in upsert event if user message - FAILED

Could you help me how can I send/receive a message using @lid to test this PR? Thanks

@kyraex

This comment was marked as off-topic.

@DavidsonGomes
Copy link
Contributor

up

1 similar comment
@diegovin16
Copy link

up

@T3uZ
Copy link

T3uZ commented Dec 5, 2023

Up

@kyraex
Copy link
Contributor

kyraex commented Dec 14, 2023

Have been testing this PR for a month and there isn't any breaking issue. +1 to merge this PR thanks!

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

Successfully merging this pull request may close these issues.