[evolution-data-server] google: Fix removal of custom vCard attributes in Google address books



commit 161faab40fa65e813ac98042ef822298dc58cfde
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Jul 22 12:49:50 2012 +0100

    google: Fix removal of custom vCard attributes in Google address books
    
    If a client had previously added a custom vCard attribute to a vCard in a
    Google address book, subsequent removal of that attribute wouldnât work,
    since the backend wasnât removing extended properties from the GData entries
    when updating them.

 addressbook/backends/google/e-book-google-utils.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/backends/google/e-book-google-utils.c b/addressbook/backends/google/e-book-google-utils.c
index ce8ab12..a235727 100644
--- a/addressbook/backends/google/e-book-google-utils.c
+++ b/addressbook/backends/google/e-book-google-utils.c
@@ -125,7 +125,7 @@ gdata_entry_update_from_e_contact (GDataEntry *entry,
                                    EContactGoogleCreateGroupFunc create_group,
                                    gpointer create_group_user_data)
 {
-	GList *attributes, *iter, *category_names;
+	GList *attributes, *iter, *category_names, *extended_property_names;
 	EContactName *name_struct = NULL;
 	EContactPhoto *photo;
 	gboolean have_email_primary = FALSE;
@@ -207,6 +207,11 @@ gdata_entry_update_from_e_contact (GDataEntry *entry,
 	for (iter = category_names; iter != NULL; iter = g_list_delete_link (iter, iter))
 		gdata_contacts_contact_remove_group (GDATA_CONTACTS_CONTACT (entry), iter->data);
 
+	extended_property_names = g_hash_table_get_keys (gdata_contacts_contact_get_extended_properties (GDATA_CONTACTS_CONTACT (entry)));
+	for (iter = extended_property_names; iter != NULL; iter = g_list_delete_link (iter, iter)) {
+		gdata_contacts_contact_set_extended_property (GDATA_CONTACTS_CONTACT (entry), iter->data, NULL);
+	}
+
 	/* We walk them in reverse order, so we can find
 	 * the correct primaries */
 	iter = g_list_last (attributes);



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