[Bug 45716] salut plugin api needs to be split out and refactored similar to the changes done to gabble

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 16 17:31:15 CET 2012


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

--- Comment #19 from Jonny Lamb <jonny.lamb at collabora.co.uk> 2012-03-16 09:31:15 PDT ---
(In reply to comment #18)
> Yes, looking at this branch again, we should move salut_send_ll_pep_event()
> into Wocky. Looking at the code seems to suggest there's nothing missing in
> Wocky, or am I missing something?

I am missing something, but it's not so bad. Currently WockyXep0118Capabilities
only handles data forms because we wanted some kind of GabbleCapabilitySet
thing in Wocky instead of just a strv, but never got around to it.

We could complete this quickly in one of a few ways I reckon:

  const gchar * const * wocky_xep_0118_capabilities_get_features (...);

  gboolean wocky_xep_0118_capabilities_has_feature (..., const gchar *feature);

  WockyCapabilitySet * wocky_xep_0118_capabilities_get_features (...);

The first option would be the easiest but the ugliest.

The second would be also very easy but would mean adding a
WockyXep0118Capabilities.has_feature vfunc which would be removed when we
finally finish the interface as has_feature probably wouldn't be needed as we
could do the same operation higher up (in WockyXep0118Capabilities itself
perhaps) so that would require breaking ABI, but Wocky is still unstable so I
wouldn't mind about that.

The third option is the best in the long term. It would mean moving
GabbleCapabilitySet to Wocky as WockyCapabilitySet (singular capability please)
but other than that pretty much verbatim. The problem with that is that
GabbleCapabilitySet uses TpIntSet as its data structure under the hood. I'm not
sure what to suggest about that. Is there a good replacement data structure in
GLib? I'm not sure.

Therefore, I would recommend the second option. Implement this simple vfunc in
Wocky, then implement it in SalutContact which will also be trivial. Perhaps it
wouldn't break ABI/API in the long term because has_feature might be a useful
vfunc to actually expose for implementations for speed purposes (if an
implementing object had to expensively create a WockyCapabilitySet every time
just to return it and have it hashed, for example).

Hopefully this makes some sense.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list