Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.05k stars 490 forks source link

Refresh Store.Chats #544

Closed hagen00 closed 3 years ago

hagen00 commented 3 years ago

This may be a silly question, but how do I refresh wac.Store.Chats?

I use this to loop through chats. Currently, LastMessageTime is only updated if I disconnect and reconnect entirely.

Can I refresh Store.Chats without having to disconnect / reconnect?

Thanks for the help and apologies for posting this as an issue.

hagen00 commented 3 years ago

wac.Chats() seems to do some form of refresh. Now instead of totally having to reconnect (kill the session on my phone, rescan QR code), I can just restart the app and it then pulls in the updated details. This is better, but still not ideal.

I'm displaying the chats in a browser, via http://localhost:8080/chats via a mux route...

hagen00 commented 3 years ago

This does not seem to be an issue on the production setup. It's possible it's because I didn't have the phone on the chat screen / active when testing. Either way, closing this.