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

Add contact_change_state event. #722

Closed
wants to merge 5 commits into from
Closed

Add contact_change_state event. #722

wants to merge 5 commits into from

Conversation

soncemvo
Copy link

@soncemvo soncemvo commented Jun 30, 2021

With this change you can recieve "typing" or "recording" events of your contacts

@tuyuribr
Copy link
Collaborator

I think that you are missing the "window.Store.Presence"

@soncemvo
Copy link
Author

I think that you are missing the "window.Store.Presence"

No, its available in Store

@tuyuribr
Copy link
Collaborator

I think that you are missing the "window.Store.Presence"

No, its available in Store

My bad, so the only thing to change is doublequotes to single quotes

@soncemvo
Copy link
Author

I think that you are missing the "window.Store.Presence"

No, its available in Store

My bad, so the only thing to change is doublequotes to single quotes

done

@PurpShell PurpShell linked an issue Jul 4, 2021 that may be closed by this pull request
@PurpShell
Copy link
Collaborator

@pedroslopez couldn't this be used to update the presence to be gotten by #553 ? You mentioned stuff about setTimeout, seems like storing the presence in some kind of variable and then accessing them by the function viable.

@pedroslopez
Copy link
Owner

Thanks for contributing! This is something that's definitely been asked for in the past.

My concern with this is that, from previous experience, WhatsApp Web doesn't subscribe to the Presence of everybody, so the results of the events you're getting may be unexpected. You might want to listen for state changes of a particular user, but WhatsApp Web might not be subscribed to their presence.

So, this brings up a few questions for me: Has this changed? If not, could we instead write a function to subscribe to someone's presence? How many contacts does WhatsApp Web subscribe to by default?

@pedroslopez pedroslopez deleted the branch pedroslopez:master July 19, 2021 02:42
@PurpShell
Copy link
Collaborator

Looking at this again, it's possible you can take a different approach.. Store.Conn should have an event for Presence, that should give you your details.. As for subscribing to a presence, pretty sure the incoming message by the WS after the sub will get funneled to the event i talked about. So you can basically resolve a promise of a "getLastSeen" once the presence for it has been delivered.

@pedroslopez

@fatihmesse
Copy link

I use the this function, at startup is it working but later than throw all chat status and stop working. How can ı fix it?
Ekran Resmi 2022-10-30 15 59 12

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.

5 participants