Bug 20903 - Support ContactCapabilities draft 2
Summary: Support ContactCapabilities draft 2
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords:
Depends on:
Blocks: 22934
  Show dependency treegraph
 
Reported: 2009-03-27 06:57 UTC by Simon McVittie
Modified: 2009-09-21 03:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2009-03-27 06:57:18 UTC
xml/Connection_Interface_Contact_Capabilities.xml is not up to date with telepathy-spec 0.17.22.

Gabble (the only implementor of ContactCapabilities) is up to date, so contact caps probably don't actually work.
Comment 1 Simon McVittie 2009-08-25 08:54:44 UTC
Slightly repurposing this bug, here is an implementation of contact caps draft 2 as seen in the latest telepathy-spec:

http://git.collabora.co.uk/?p=user/smcv/telepathy-mission-control-smcv.git;a=shortlog;h=refs/heads/contact-caps-draft2

With this branch, MC supports ancient Capabilities, draft 1 ContactCapabilities and draft 2 ContactCapabilities simultaneously.
Comment 2 Will Thompson 2009-09-10 09:36:19 UTC
+        TpHandle handle = tp_handle_ensure (dispatcher->priv->string_pool,
+                                            cap_tokens[i], NULL, NULL);
+
+        if (handle != 0)

It should never be 0, surely.

+        vas = g_ptr_array_sized_new (g_hash_table_size (self->priv->clients));
+
+        g_hash_table_iter_init (&iter, self->priv->clients);
+
+        while (g_hash_table_iter_next (&iter, NULL, &p))
+        {
+            mcd_dispatcher_append_client_caps (self, p, vas);
+        }

         // do some stuff

+        g_ptr_array_foreach (vas, (GFunc) g_value_array_free, NULL);
+        g_ptr_array_free (vas, TRUE);

This code occurs twice; maybe it's worth function-ifying? That said, it would be longer that way. :)

Otherwise, looks good!
Comment 3 Simon McVittie 2009-09-10 11:38:20 UTC
Sorry, there are more patches...
Comment 4 Simon McVittie 2009-09-10 11:47:24 UTC
(In reply to comment #2)
> +        TpHandle handle = tp_handle_ensure (dispatcher->priv->string_pool,
> +                                            cap_tokens[i], NULL, NULL);
> +
> +        if (handle != 0)
> 
> It should never be 0, surely.

No, that check is indeed pointlessly defensive, and I've removed it.

> +        vas = g_ptr_array_sized_new (g_hash_table_size (self->priv->clients));
> +
> +        g_hash_table_iter_init (&iter, self->priv->clients);
[...]
> This code occurs twice; maybe it's worth function-ifying?

The contact-caps-early branch does functionify it, but then doesn't use it in one of the places where it could (which I have now corrected).
Comment 5 Simon McVittie 2009-09-11 11:18:03 UTC
Fixed in git, will be in 5.3.0
Comment 6 Simon McVittie 2009-09-21 03:12:21 UTC
5.3.0


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.