venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.14k forks source link

Two Absurdities #435

Open Dynogic opened 11 years ago

Dynogic commented 11 years ago

Alright, here are two things that I still can't wrap my head around. It'll be appreciated if someone can help me here.

Firstly, how do status' exactly get refreshed? On auth, a status key-value (or node) does get sent as a feature (similar to a pictures request - that tells the server, hey, when someone updates their picture, tell me it updated so I can fetch a new one). It works beautifully. However, when an arbitrary person's status gets updated, a "status updated" message never comes through. Do we really NEED to periodically update status' by calling a contact sync every damn time? There must be a more efficient approach.

Secondly, ping/pong seems to be deprecated. Pings never come through anymore... and after 15 or so minutes of inactivity, the server stops replying to your requests (or sending anything back) and leaves the connection open. So either a) you must send a useless node (like a last online query) every few minutes if the client is idling to ensure the connection stays alive, or b) somehow destroy and restart the client iff the server sends some 'teardown' node i'm unaware of. I'll to more research on the latter case today.

Any help will be appreciated, @shirioko et al.

shirioko commented 11 years ago

Status is downloaded using contact sync, but I saw some status subscription argument in the features node if I recall correctly, much like the picture subscription argument which is already implemented. But I'm pretty sure the status only gets updated after contact sync :/

Ping handler is still in the node processor code, but I wasn't able to receive a ping node it for quite a while now. I'll look into the C# code again to see if something comes up.

Dynogic commented 11 years ago

As I recall, in their implementation, those events looked only to be fired when you make a status update, and only you. That will explain the ... please wait progress dialog on Android when you make the status update.

Alrighty.