Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

Fix pfp change notification

Open codebossdev opened this issue 1 year ago • 4 comments

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

codebossdev avatar Aug 10 '23 05:08 codebossdev

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

whiskeysockets-bot avatar Aug 10 '23 05:08 whiskeysockets-bot

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":{}}}

Alhar6i avatar Aug 11 '23 14:08 Alhar6i

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.

Alhar6i avatar Aug 20 '23 05:08 Alhar6i

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

purpshell avatar Jan 19 '24 17:01 purpshell