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

Consider blocklist before automatically adding contacts #200

Open
dreamlayers opened this issue May 17, 2024 · 8 comments
Open

Consider blocklist before automatically adding contacts #200

dreamlayers opened this issue May 17, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@dreamlayers
Copy link

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
Copy link
Owner

Hi @dreamlayers

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

Kind Regards
Hermann

@dreamlayers
Copy link
Author

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
Copy link
Owner

hoehermann commented May 17, 2024

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
Copy link
Author

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

(19:15:37) whatsmeow: recieved name (subtype 0) for account 0xredacted remote [email protected] (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
Copy link
Owner

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.

@hoehermann hoehermann changed the title Removed buddies come back after restarting Pidgin Consider blocklist before automatically adding contacts May 21, 2024
@hoehermann hoehermann added the enhancement New feature or request label May 21, 2024
@hoehermann
Copy link
Owner

Checking the blocklist is now implemented in 47cb45e. However, after blocking a contact to the blocklist, WhatsApp servers seem to block them quite efficiently. For this reason, the feature is untested, unfortunately. 😐 I am mildly optimistic, though. In case it does not work for you, feel free to re-open this issue.

@dreamlayers
Copy link
Author

I just built a new version using the latest from whatsmeow branch, did cpack, and installed the .deb package in Ubuntu 24.04. After starting Pidgin I re-enabled the "Automatically add contacts" option. Then I quit Pidgin 2.14.13 (libpurple 2.14.13) and started it again. My Whatsapp Pidgin group is again full of old spammers I had deleted. Restarting Pidgin or disconnecting from WhatsApp and reconnecting makes them come back if I delete them.

I had verified that git was on the proper branch and unmodified, I had deleted the build directory. Now /usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so is identical to the one I built. So, it seems this has not been fixed.

Just to clarify again, the problem is not messages. Either these contacts don't send me messages or WhatsApp blocks those messages on the server. The problem is that they appear in my contact list and clutter it up. I don't want old spam accounts on my contact list. But for now, disabling the "Automatically add contacts" option is a good enough workaround.

@hoehermann hoehermann reopened this Oct 6, 2024
@hoehermann
Copy link
Owner

Maybe related: Contacts and groups deleted on the main device are still returned by ContactStore.GetAllContacts(). Perhaps the Found field can help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants