Bug 20903

Summary: Support ContactCapabilities draft 2
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: mission-controlAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-mission-control-smcv.git;a=shortlog;h=refs/heads/contact-caps-early
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 22934    

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.