[folks] e-d-s: Make sure we clear old attributes when setting im_addresses



commit 5b99efd1c1f5db653b5e736864d6299b495ef884
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Sep 9 10:25:37 2011 +0200

    e-d-s: Make sure we clear old attributes when setting im_addresses
    
    The previous code called e_contact_get_attributes() which returns
    a copy of the attributes, and tried to remove it with
    e_vcard_remove_attribute () which matches on pointer values, so
    it always failed.

 backends/eds/lib/edsf-persona-store.vala |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index 3698626..715ec24 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -1527,14 +1527,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       /* First let's remove everything */
       foreach (var field_id in im_eds_map.get_values ())
         {
-          /* Technically it's a (transfer full) list, but remove_attribute()
-           * swallows ownership. */
-          GLib.List<unowned VCardAttribute> attrs =
-              contact.get_attributes (field_id);
-          foreach (var attr in attrs)
-            {
-              contact.remove_attribute (attr);
-            }
+          contact.remove_attributes (null, E.Contact.vcard_attribute (field_id));
         }
 
      foreach (var proto in im_fds.get_keys ())



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