Bug 24653 - Should implement ContactCapabilities
Summary: Should implement ContactCapabilities
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: salut (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.freedesktop.org/~jonny/te...
Whiteboard: review+
Keywords: patch
Depends on: 19684
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-21 03:57 UTC by Guillaume Desmottes
Modified: 2011-03-18 04:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Guillaume Desmottes 2009-10-21 03:57:23 UTC
We'd like to use ContactCapability in Empathy to check if contacts support FT but this is blocked by Salut implementing an old draft of this API.
https://bugzilla.gnome.org/show_bug.cgi?id=599164
Comment 1 Simon McVittie 2010-10-07 08:03:08 UTC
Yes it should, but first, it needs to implement its draft version more sanely.
Comment 2 Jonny Lamb 2011-03-17 08:03:51 UTC
LOOK MA, I DID IT.
Comment 3 Will Thompson 2011-03-17 09:52:15 UTC
This looks fine. I've got a couple of nitpicks, but neither is a blocker.

+      const gchar *client_name = g_value_get_string (va->values + 0);
+      const GPtrArray *filters = g_value_get_boxed (va->values + 1);
+      const gchar * const * cap_tokens = g_value_get_boxed (va->values + 2);

I could suggest using tp_value_array_unpack here? I don't know how much clearer it would actually be.

  if (!announce_self_caps (self, &error))
    {
      gabble_capability_set_free (before);
      dbus_g_method_return_error (context, error);
      g_error_free (error);
      return;
    }

  if (!gabble_capability_set_equals (before, after))
    {
      _emit_contact_capabilities_changed (self, base->self_handle);
    }

I'm tempted to say that the former block should be inside the latter — why would we want to publish updated caps if they haven't changed? I know this isn't a regression in your branch.
Comment 4 Jonny Lamb 2011-03-18 01:51:34 UTC
(In reply to comment #3)
> +      const gchar *client_name = g_value_get_string (va->values + 0);
> +      const GPtrArray *filters = g_value_get_boxed (va->values + 1);
> +      const gchar * const * cap_tokens = g_value_get_boxed (va->values + 2);
> 
> I could suggest using tp_value_array_unpack here? I don't know how much clearer
> it would actually be.

I'd rather just keep it the same tbh as it'll be the same as gabble, not sure how much of an argument that really is.. anyway, yeah, deal widdit.

> I'm tempted to say that the former block should be inside the latter — why
> would we want to publish updated caps if they haven't changed? I know this
> isn't a regression in your branch.

Yeah you're right, I've fixed this. See the latest patch on my branch then.
Comment 5 Jonny Lamb 2011-03-18 02:45:20 UTC
OH, and I've added capabilities-set and caps-channel-manager to the plugin API. See this branch on top of this one:

http://cgit.freedesktop.org/~jonny/telepathy-salut/log?h=plugin-caps
Comment 6 Will Thompson 2011-03-18 03:31:55 UTC
both look fine!
Comment 7 Jonny Lamb 2011-03-18 04:14:05 UTC
le done.


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.