Skip to content

Conversation

@fourjr
Copy link

@fourjr fourjr commented Feb 17, 2025

This functionality does not work on all WhatsApp mobile apps. I suggest testing using a WhatsApp desktop client as the contact changes are reflected there.

Example Usage

// add or edit contact
client.SendAppState(appstate.BuildContact(v.Info.Sender, "Full Name"))
// remove contact
client.SendAppState(appstate.RemoveContact(v.Info.Sender))

@AlejandroPerez92
Copy link
Contributor

That is awesome! It could probably prevent some bans

@fourjr fourjr requested a review from purpshell February 19, 2025 06:09
Copy link
Contributor

@purpshell purpshell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks pretty good to me

Copy link
Contributor

@devlikepro devlikepro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk how for others, but I'd expect method RemoveContact to actually "remove the contact".

For consistency with other methods, we could apply the changes, so the function name makes sense, because it actually "builds remove contact" data - so BuildRemoveContact

The same for BuildAddContact

Or even

  • BuildAddContactPatch
  • BuildRemoveContactPatch

a bit wordy, but show what the methods actually do

}
}

func BuildContact(target types.JID, fullName string) PatchInfo {
Copy link
Contributor

@devlikepro devlikepro Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func BuildContact(target types.JID, fullName string) PatchInfo {
func BuildAddContact(target types.JID, fullName string) PatchInfo {

OR

Suggested change
func BuildContact(target types.JID, fullName string) PatchInfo {
func BuildAddContactPatch(target types.JID, fullName string) PatchInfo {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current naming is consistent with the entire file though?

}
}

func RemoveContact(target types.JID) PatchInfo {
Copy link
Contributor

@devlikepro devlikepro Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func RemoveContact(target types.JID) PatchInfo {
func BuildRemoveContact(target types.JID) PatchInfo {

OR

Suggested change
func RemoveContact(target types.JID) PatchInfo {
func BuildRemoveContactPatch(target types.JID) PatchInfo {

@huzairuje
Copy link

nice to have and i am abit lost when something with contacts management, LGTM

@ashuvax
Copy link

ashuvax commented Apr 24, 2025

any updates?

@RakaiSeto
Copy link

this feature will be very good, looking forward to it

Copy link
Contributor

@purpshell purpshell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is stable now. For it to work though, you need to enable a little trigger on the main device.

Note that that these contacts only stay on WhatsApp itself rather than becoming system-level, but it does make it better for keeping contacts separate if you have multiple numbers per device 👀.

@Valdenirmezadri
Copy link

This feature is stable now. For it to work though, you need to enable a little trigger on the main device.

Note that that these contacts only stay on WhatsApp itself rather than becoming system-level, but it does make it better for keeping contacts separate if you have multiple numbers per device 👀.

where is the little trigger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants