[Bug 71508] [1.0] simplify TpPresenceMixin

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 17 06:18:08 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=71508

--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
(In reply to comment #0)
> Now that we have SimplePresence:
> 
> TpPresenceStatusOptionalArgumentSpec should go away altogether.
> 
> TpPresenceStatusSpec should replace
> 
>     gboolean self;
>     const TpPresenceStatusOptionalArgumentSpec *optional_arguments;
> 
> with
> 
>     typedef enum {
>         /*< flags >*/
>         TP_PRESENCE_STATUS_SPEC_FLAGS_NONE = 0,
>         TP_PRESENCE_STATUS_SPEC_FLAGS_CAN_SET_ON_SELF = (1 << 1),
>         TP_PRESENCE_STATUS_SPEC_FLAGS_HAS_MESSAGE = (1 << 2)
>     } TpPresenceStatusSpecFlags;
> 
>     TpPresenceStatusSpecFlags flags;
> 
> (or possibly a pair of gbooleans but I think it's clearer as a flags word).

The pair-of-booleans is implemented now, but I still think a flags-word would
be better.

> The vfuncs in TpPresenceMixinClass should move to a GInterface that the
> Connection implements (TpPresenceMixable?), to allow for introspection in
> future.

Xavier and I came up with a better idea on Bug #77189:
TpPresenceMixin[Interface] is a GInterface, storing data on the connection with
qdata, so we only need init() and fill_contact_attributes().

> or maybe even
> 
> TpPresenceStatus *tp_presence_status_new (TpPresenceMixable *self,
>     const TpPresenceStatusSpec *spec,
>     const gchar *message) G_GNUC_WARN_UNUSED_RESULT;
> 
> TpPresenceMixinStatusAvailableFunc should take a const TpPresenceStatusSpec
> * too.

I still like this idea, but making it introspectable leads to some annoying
boilerplate in CMs, so we might need more thought.

I'm half tempted to turn TpPresenceStatusSpec into a GObject.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.


More information about the telepathy-bugs mailing list