hoehermann / purple-gowhatsapp

Pidgin/libpurple plugin for WhatsApp Web.
GNU General Public License v3.0
276 stars 34 forks source link

Consider blocklist before automatically adding contacts #200

Open dreamlayers opened 1 month ago

dreamlayers commented 1 month ago

Using Pidgin 1:2.14.13-1ubuntu2 in x86_64 Ubuntu 24.04, and the tag: v1.14.0 build, removed buddies do not stay removed. I can right click on a buddy, select Remove from the menu, confirm that in the dialog box, and the buddy is removed. But if I quit Pidgin and start it again, the buddy comes back. I also experienced this problem in earlier builds, and just updated before reporting the issue.

This is a problem because I have senders of spam from a long time ago still on my contact list. I've deleted them a long time ago in the official WhatsApp application in Android. I could find some of them in the list of blocked contacts in the Android app, but deleting them from there did not help.

hoehermann commented 1 month ago

Hi @dreamlayers

Thank you for the report. Does unchecking the option "Automatically add contacts" help?

Kind Regards Hermann

dreamlayers commented 1 month ago

Does unchecking the option "Automatically add contacts" help?

@hoehermann, thank you, that solves the problem. I can now remove a contact, quit Pidgin, start Pidgin again, and the contact does not reappear.

This is good enough as a workaround for me. I actually prefer adding contacts manually, and not automatically whenever I receive a message. Though, I still consider this a bug, because the contacts that reappeared hadn't sent me any messages in a long time. So, I don't know what was causing them to be added automatically.

hoehermann commented 1 month ago

There are two situations when contact information arrives at the client: When receiving a message and also right after scanning the QR-code. The setting covers them both, but currently does not discriminate between the situations.

During the pairing process, my account receives information about people I do not even know personally. I stopped wondering about it.

dreamlayers commented 1 month ago

I get these via Help -> Debug Window when connecting to WhatsApp:

(19:15:37) whatsmeow: recieved name (subtype 0) for account 0xredacted remote redacted@s.whatsapp.net (isGroup 0) sender (null) (alias redacted, isOutgoing 0) sent 0: (null)

These kinds of things are the only mentions in the log of the contacts that kept reappearing before, when "Automatically add contacts" was enabled. Even blocked contacts get log entries like that. No messages are being received. So, I guess these "recieved name" events add things to the contact list.

hoehermann commented 1 month ago

I guess these "recieved name" events add things to the contact list.

This guess is correct.

Due to this discussion, I looked into the docs and noticed there is a https://pkg.go.dev/go.mau.fi/whatsmeow#Client.GetBlocklist function. I could probably exclude blocked contacts from the auto-add feature.