Summary: | Port more channel implementations to GabbleBaseChannel | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Will Thompson <will> |
Component: | gabble | Assignee: | Will Thompson <will> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | Keywords: | patch |
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/wjt/telepathy-gabble-wjt.git;a=shortlog;h=refs/heads/basic | ||
Whiteboard: | review+ | ||
i915 platform: | i915 features: |
Description
Will Thompson
2010-04-28 02:10:02 UTC
> + presence = gabble_presence_cache_get (self->parent.conn->presence_cache, > + self->parent.target); We generally avoid relying on the @parent member of instance structs like this, since it breaks if you change the inheritance hierarchy to include an extra intermediate class, which is meant to be something that's always safe in OO. I'd be inclined to use: GabbleBaseChannel *base = (GabbleBaseChannel *) self; presence = gabble_presence_cache_get (base->conn->presence_cache, base->target); (Or you could call it @chan instead of @base, or something.) > @@ -462,23 +234,23 @@ gabble_im_channel_dispose (GObject *object) > + self->parent.conn->roster, base->target); Er, this mixes both modes in consecutive arguments :-) Other than that, review+. (In reply to comment #1) > > + presence = gabble_presence_cache_get (self->parent.conn->presence_cache, > > + self->parent.target); > > We generally avoid relying on the @parent member of instance structs like this, > since it breaks if you change the inheritance hierarchy to include an extra > intermediate class, which is meant to be something that's always safe in OO. Normally I would kick up a fuss because I think that this is boilerplate for a pretty much theoretical gain. However, I did just add an extra intermediate class, and was inconsistent about which style I used in this branch. So... patch pushed. ship it! commit 89f15409121bad8adfddde28ce40c7418f33a22c Merge: 84a6dbd 28a63ce Author: Will Thompson <will.thompson@collabora.co.uk> Date: Mon May 3 13:52:44 2010 +0100 Merge branch 'basic' Closes https://bugs.freedesktop.org/show_bug.cgi?id=27865. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> |
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.