Baileys
Baileys copied to clipboard
Fix pfp change notification
Beforehand, it would try to set the picture as the baileys' user because of the "from" attribute, but this has been corrected to either use the jid attribute or the hash for non-contacts (not saved)
Some md5 hash comparison occurs and we can find the contact to update
also, prior to this update, the field would've just stayed at "changed" and cached that too, which would've caused a bunch of crashes I guess at "store.fetchImageUrl" Because of this though, a socket is recommended to be passed into the config
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-contact-notifs
# YARN v2
yarn add @whiskeysockets/baileys@WhiskeySockets/Baileys#fix-contact-notifs
I update my project based on the PR.
In the case of Groups, I get this error when calling profilePictureUrl function:
{"data":{"stack":"Error: \n at promiseTimeout (C:\inetpub\vhosts\mersaliy.com\WAAPI5001\lib\Utils\generics.js:154:19)\n at waitForMessage (C:\inetpub\vhosts\mersaliy.com\WAAPI5001\lib\Socket\socket.js:112:61)\n at query (C:\inetpub\vhosts\mersaliy.com\WAAPI5001\lib\Socket\socket.js:135:22)\n at Object.profilePictureUrl (C:\inetpub\vhosts\mersaliy.com\WAAPI5001\lib\Socket\chats.js:392:30)\n at C:\inetpub\vhosts\mersaliy.com\MersaliyWAAPISource\wa\waserver.ts:611:64"},"isBoom":true,"isServer":false,"output":{"statusCode":408,"payload":{"statusCode":408,"error":"Request Time-out","message":"Timed Out"},"headers":{}}}
The update has an issue in the case of fetching the group profile picture. I'm not sure where is the problem but I get the error mentioned in my previous comment after applying the PR in my code.
The update has an issue in the case of fetching the group profile picture. I'm not sure where is the problem but I get the error mentioned in my previous comment after applying the PR in my code.
This is not related to that at all. This only updates the contact in a memory store to accurately reflect profile picture info. Groups or not is not the problem