Properly serialize AFD values for the Tp cache.
authorTravis Reitter <travis.reitter@collabora.co.uk>
Thu, 10 Nov 2011 00:34:22 +0000 (16:34 -0800)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Thu, 10 Nov 2011 00:46:11 +0000 (16:46 -0800)
We were previously writing serialized Telepathy AbstractFieldDetails
values over each other in the final array, which was generally bad
and specifically crashed Gnome Shell.

This affects AFD-derived structures: phone numbers, email addresses,
and URLs.

Closes: bgo#662314 - Gnome-shell restarts if I change my user status to
disconnected/unavailable

NEWS
backends/telepathy/lib/tpf-persona-store-cache.vala

diff --git a/NEWS b/NEWS
index fa24e5f..1c51c3a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ Bugs fixed:
 * Bug 662616 — We should set mime type when setting an EContact's photo
 * Bug 662274 — Failed to link personas: Can't link personas with no primary
   store.
+* Bug 662314 — Gnome-shell restarts if I change my user status to
+  disconnected/unavailable
 
 API changes:
 * Add AbstractFieldDetails.id to identify instances of details
index 150fe5f..352a5f5 100644 (file)
@@ -147,14 +147,14 @@ internal class Tpf.PersonaStoreCache : Folks.ObjectCache<Tpf.Persona>
             {
               foreach (var val in afd.parameters.get (key))
                 {
-                  parameters[f] = new Variant.tuple ({
+                  parameters[f++] = new Variant.tuple ({
                     new Variant.string (key), // Key
                     new Variant.string (val) // Value
                   });
                 }
             }
 
-          output_variants[i] = new Variant.tuple ({
+          output_variants[i++] = new Variant.tuple ({
             afd.value, // Variant value (e.g. e-mail address)
             new Variant.array (new VariantType.tuple ({
               VariantType.STRING, // Key