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

@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

This comment was marked as abuse.

@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

This comment was marked as abuse.

javiercr added a commit to TextsHQ/baileys that referenced this pull request Nov 16, 2023
Original PR
WhiskeySockets/Baileys#408

# Conflicts:
#	src/Socket/messages-send.ts
#	src/Utils/crypto.ts
#	src/Utils/messages.ts
javiercr added a commit to TextsHQ/baileys that referenced this pull request Nov 16, 2023
@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.