tomer8007 / whatsapp-web-incognito

A Chrome extension that disables read receipts and presence updates on WhatsApp Web
MIT License
312 stars 74 forks source link

"Don't send "Last Seen" and "Typing" updates" checkbox changes don't update immediately #155

Closed IsaacHatton closed 4 months ago

IsaacHatton commented 4 months ago

When you change the "Don't send "Last Seen" and "Typing" updates" checkbox, the setting is only respected when the page reloads.

Should the text be modified to say it requires a reload, should the page reload or is there a way to make it work without a reload?

tomer8007 commented 4 months ago

I am aware that this is indeed the case when you un-tick this option. When you tick it, it should affect right away. The relevant enforcing variable is actually changed immediately but it doesn't do the effect when un-ticking. I think it's basically because the client stops to send presence updates until you reload or something like that.

I don't think this is a big enough problem to be described in the GUI. Maybe we can just how an alert when un-ticking saying you should refresh.

IsaacHatton commented 4 months ago

Maybe it's my environment, but loading the page in with the box unticked, then ticking it seems to not block the online reciepts? Mobile devices were locked with the screen turned off. Left side is my main with the current Chrome Webstore version Right side is my test with no extension

This behaviour was very annoyingly intermittent, it seems to only work sometimes, and I can't figure out what I am doing different (might be a timing thing).

image

As a sidenote, a second mobile device linked as a secondary device to an account shows up as a laptop under the "Show device of messages" feature, but I presume that's not something that's worth creating a change over?

tomer8007 commented 4 months ago

I probably missed something then. Will re-check this. EDIT: I thought about it, it's probably because when you start blocking presence updates, you need to be inactive for some time, so that the "not-available" update will be sent. Only then, further "available" updates will be blocked. It is possible to add to the extension a code that will auto-send the "not-available" update once you tick that option.

a second mobile device linked as a secondary device to an account shows up as a laptop under the "Show device of messages" feature,

Oh, that makes sense because I identify a computer based on the assumption there can't be a second mobile device. How is this possible?

IsaacHatton commented 4 months ago

https://blog.whatsapp.com/one-whatsapp-account-now-across-multiple-phones

I only use it on my test account, where the primary is Dual Messenger on my android and companion is an old iPhone and a second Edge profile on my laptop.

On my primary, I have Whatsapp for Windows and my main Edge profile as companions.

tomer8007 commented 4 months ago

https://blog.whatsapp.com/one-whatsapp-account-now-across-multiple-phones

I see. The update that added the "Show device" feature was released in March 2023, before this announcement. Also see my edit regarding the "Last seen" feature.

IsaacHatton commented 4 months ago

RE the edited message, that makes sense and would explain the testing behaviour I saw, do you know what function can be called to make the person be marked as "not-available"?

tomer8007 commented 4 months ago

I need to look at the code a little bit to find the function. I guess it will have a promising name, like this one I use to send a read receipt:

https://github.com/tomer8007/whatsapp-web-incognito/blob/1ff6d7a5ce7d810fbc4186d3cdd65ba982298365/core/injected_ui.js#L214

IsaacHatton commented 4 months ago

This is functional, is this what we are looking for? image From my testing, Name can be left blank.

I can't seem to find it in WhatsAppAPI but maybe I'm looking in the wrong place.

tomer8007 commented 4 months ago

Fixed in pull request #156 .