Martin Atkins (mart) wrote in lj_dev,
Martin Atkins
mart
lj_dev

Friends page update notification in clients

We've seen the new mode=live thing you can now do on your friends page, which refeshes a small frame with some JavaScript in it and thus only updates your friends page when there is a change. I now propose a protocol addition to do similarly!

The client would just make a simple request, say mode=checkfriends&user=test&password=test, and the server would reply with a single variable set to either 0 or 1 depending on whether there has been a change. The clients can make this request at minimum every 30 seconds, and this will be enforced on the server-side by rejecting requests more often than that from the same username. This won't actually stop it being made more than every 30secs, but it would at least make it pointless so there's no advantage to it. Since the server would have to 'remember' the last time the client checked, this also has the advantage that the client doesn't have to send this every time.

What the client does next is up to itself (or its settings). The Win32 client, for example, could show a simple anim of the little pencil scribbling, spinning or such. Failing that, a dialog could simply be displayed. The client should at this point cease making the request periodically, since it knows there has been an update. This will mean that people with permanent connections who leave their clients running all day when they aren't around will at least stop making this request at some point!

I believe this is the best way to do what is at best a dirty hack (as is mode=live!), but of course feel free to suggest improvements, or tell me I'm a fool.

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 11 comments