Bug 27790

Summary: Cork presence updates from Google Talk when device is idle
Product: Telepathy Reporter: Will Thompson <will>
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: 0.8   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/wjt/telepathy-gabble-wjt.git;a=shortlog;h=refs/heads/device-idle
Whiteboard: review+
i915 platform: i915 features:

Description Will Thompson 2010-04-22 04:07:46 UTC
<http://mail.jabber.org/pipermail/summit/2010-February/000528.html> describes a Google Talk extension which allows the client to ask the server to queue up presence updates rather than sending them to it immediately. This has the side-effect of reducing the frequency of the server's whitespace pings to about once every 30 minutes, rather than once every 30 seconds, which would fix <https://bugs.maemo.org/show_bug.cgi?id=8581>.

I have a branch of 0.8 which makes Gabble listen to an MCE event stating that the device has become inactive or active, and send the relevant commands to the server. It's Maemo-specific — we don't have a standard way to do this on the desktop — but hey.
Comment 1 Will Thompson 2010-04-22 04:11:48 UTC
One thing this branch doesn't do is replace our whitespace keepalive pings (which are sent less frequently than the GTalk server's pings) with the <flush/> command. I'm not sure whether that's a good idea, in any case. The radio's waking up every few minutes for the keepalives, so on the one hand we may as well; on the other hand, eds-backend-telepathy on Maemo 5 listens to this same MCE signal and doesn't push presence updates to the UI when the device is idle, so they'd be ignored anyway.
Comment 2 Simon McVittie 2010-04-22 08:31:19 UTC
> +gabble_slacker_dispose (GObject *object)

Should chain up to the parent's dispose

> +gabble_slacker_finalize (GObject *object)

Should chain up to the parent's finalize, or just not exist

Otherwise, looks good to me.
Comment 3 Will Thompson 2010-04-26 03:11:53 UTC
(In reply to comment #2)
> > +gabble_slacker_dispose (GObject *object)
> 
> Should chain up to the parent's dispose

Done.
> 
> > +gabble_slacker_finalize (GObject *object)
> 
> Should chain up to the parent's finalize, or just not exist

Deleted.
Comment 4 Simon McVittie 2010-04-26 03:21:30 UTC
review+, ship it.

One minor comment:

+  ((GObjectClass *) gabble_slacker_parent_class)->dispose (object);

This assumes that the parent class *has* a dispose(). For dispose() that's OK, because its parent is GObject, which has an API guarantee that it will do certain things (e.g. kill off weak refs) when disposed, hence it must continue to have a dispose() forever; but it's not OK for (say) constructed(), so I've been using a "check before chaining up" pattern consistently for all similar functions.

(For instance, see
<http://git.collabora.co.uk/?p=telepathy-glib.git;a=commitdiff;h=9cc5f93f913896c7053c78b09d1f745cfebd58cd>.)
Comment 5 Will Thompson 2010-04-26 03:36:50 UTC
(In reply to comment #4)
> review+, ship it.

Shipped to 0.8.

> One minor comment:
> 
> +  ((GObjectClass *) gabble_slacker_parent_class)->dispose (object);
> 
> This assumes that the parent class *has* a dispose().

Yes, I know.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.