-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Contact #2325
fix: Contact #2325
Conversation
The function compares the currently used WWeb version with the version that requires the code changes. Its purpose is to ensure the stable operation of the library across different WWeb versions.
Boa noite, funcionou perfeitamente aqui, obrigado. |
hi. edit: it also fixes the client.getContacts() and probably any other calls that returns Contact or Contact[]. |
Thank you for your test, |
It still returns the contact as undefined, when sending the contact to another contact and saving it in the mysql database, it worked perfectly before. |
Provide the code you used |
ok |
@PedroLGaldino console.log(await client.getWWebVersion()); did you run |
Yes: { |
@PedroLGaldino console.log(await client.getWWebVersion());
console.log(await client.getContactById(/** number@c.us */); and send the output without sensitive information? |
PrivateContact { The contact appears in the log. So I'm getting it wrong in my code |
@PedroLGaldino what about this? console.log(await client.getWWebVersion()); |
Sorry 2.2327.4 |
Is it a buisiness contact? Because i havent checked the fix on buisiness contacts yet |
Yes its a bussines acount and bussines contact. So I'll wait for the solution, if you need help I'm available |
Thank you for your tests, ill check later and make required changes |
@PedroLGaldino i made some changes so you can test it, please let me know if you have issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just worked fine for me, i had some issues recently with wwebjs that multiplied some groups generating a new group with a new id, this group was recognized as a contact and received the new messages, while the old one only sent, after this patch the problem is fixed.
wwebjs version test was 1.21 and 1.95
It works for me. Thanks |
worked for me, thanks |
Worked here, thank you very much! |
bro where is the merge🤨 |
Mais alguem com problemas para baixar no ?? |
The error you got is unrelated to this PR, check your git/npm settings on the VM |
Ok I was able to install it and it works fine. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix: Contact (pedroslopez#2325) * fixed: contact info retrieving * fixed: block method * fixed: isBlocked property is now changeble * added inner function to compare between WWeb versions The function compares the currently used WWeb version with the version that requires the code changes. Its purpose is to ensure the stable operation of the library across different WWeb versions. * added: todo remove useOldImplementation * improved inner function to compare WWeb versions * inner function: added support for beta versions * added support for business accounts * module queries changed to strings * fixed check for wweb beta versions * updated to throw a custom error message * minor changes in inner function * feat: send photo/video as a view once message (pedroslopez#2317) * added isViewOnce property * docs updated * added usage example * fix: ESLint * feat: add new link with phone option without regen observer * feat: implement code regeneration observer * chore: revert .gitignore change * chore: .gitignore EOF * refactor: replace wrong `LinkingOption` param type with `object` * refactor: make qr handler use the new `linkingMethod.qr.maxRetries` * test: add new test cases for linking method * refactor: improve new code checking * test: replace number with a number provided in the `.env` * refactor: improve constructor typing * refactor: make never properties optional --------- Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
* fixed: contact info retrieving * fixed: block method * fixed: isBlocked property is now changeble * added inner function to compare between WWeb versions The function compares the currently used WWeb version with the version that requires the code changes. Its purpose is to ensure the stable operation of the library across different WWeb versions. * added: todo remove useOldImplementation * improved inner function to compare WWeb versions * inner function: added support for beta versions * added support for business accounts * module queries changed to strings * fixed check for wweb beta versions * updated to throw a custom error message * minor changes in inner function
* fix: Contact (pedroslopez#2325) * fixed: contact info retrieving * fixed: block method * fixed: isBlocked property is now changeble * added inner function to compare between WWeb versions The function compares the currently used WWeb version with the version that requires the code changes. Its purpose is to ensure the stable operation of the library across different WWeb versions. * added: todo remove useOldImplementation * improved inner function to compare WWeb versions * inner function: added support for beta versions * added support for business accounts * module queries changed to strings * fixed check for wweb beta versions * updated to throw a custom error message * minor changes in inner function * feat: send photo/video as a view once message (pedroslopez#2317) * added isViewOnce property * docs updated * added usage example * fix: ESLint * feat: add new link with phone option without regen observer * feat: implement code regeneration observer * chore: revert .gitignore change * chore: .gitignore EOF * refactor: replace wrong `LinkingOption` param type with `object` * refactor: make qr handler use the new `linkingMethod.qr.maxRetries` * test: add new test cases for linking method * refactor: improve new code checking * test: replace number with a number provided in the `.env` * refactor: improve constructor typing * refactor: make never properties optional --------- Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
* fixed: contact info retrieving * fixed: block method * fixed: isBlocked property is now changeble * added inner function to compare between WWeb versions The function compares the currently used WWeb version with the version that requires the code changes. Its purpose is to ensure the stable operation of the library across different WWeb versions. * added: todo remove useOldImplementation * improved inner function to compare WWeb versions * inner function: added support for beta versions * added support for business accounts * module queries changed to strings * fixed check for wweb beta versions * updated to throw a custom error message * minor changes in inner function
PR Details
- Description
- Motivation and Context
- Related Issues
- How Has the PR Been Tested
- Types of Changes
Description
Contact
class:Client.getContactById()
method now retreives the valid contact infoContact.block()
method fixed to block a contactContact.isBlocked
property changes after theblock()
orunblock()
methods are calledIts purpose is to provide a compatibility between old code implementations and a new updates made for the library to be synced with the newer WWeb versions. The thing will ensure the stable work for WWebJS no matter what version of WWeb is used.
Motivation and Context
After the WWeb v2.2327.4 the contact data structure has been modified causing some of the
Contact
class field values to beundefined
, so it would be nice to fix an issue and keep this lib up-to-date with the latest WWeb version.Related Issues
PR fixes #2299 fixes #2312
How Has This Been Tested
The code used in tests:
Tested On
Types of accounts:
Environment:
To test this PR by yourself you can run one of the following commands:
If you encounter any issues while testing this PR, please provide in a comment:
console.log(await client.getWwebVersion());
Types of Changes
Checklist