[folks] Properly serialize AFD values for the Tp cache.



commit 7539d6182295bfcaff921a4050a04980d109954c
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Wed Nov 9 16:34:22 2011 -0800

    Properly serialize AFD values for the Tp cache.
    
    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                                               |    2 ++
 .../telepathy/lib/tpf-persona-store-cache.vala     |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index fa24e5f..1c51c3a 100644
--- 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
diff --git a/backends/telepathy/lib/tpf-persona-store-cache.vala b/backends/telepathy/lib/tpf-persona-store-cache.vala
index 150fe5f..352a5f5 100644
--- a/backends/telepathy/lib/tpf-persona-store-cache.vala
+++ b/backends/telepathy/lib/tpf-persona-store-cache.vala
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]