From 93e268731dad2c7529879ac99aef1e1ab216463d Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 22 Jan 2004 23:44:35 +0000 Subject: [ fixes bug #53184 ] handle the fact that the xml 1.4 spits out contains 2004-01-22 Chris Toshok [ fixes bug #53184 ] * gui/component/addressbook-migrate.c (migrate_contacts): handle the fact that the xml 1.4 spits out contains unescaped ';'s in the EMAIL attributes for mailing lists. svn path=/trunk/; revision=24374 --- addressbook/ChangeLog | 7 ++++++ addressbook/gui/component/addressbook-migrate.c | 30 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index ffd2fab031..e656ad2861 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2004-01-22 Chris Toshok + + [ fixes bug #53184 ] + * gui/component/addressbook-migrate.c (migrate_contacts): handle + the fact that the xml 1.4 spits out contains unescaped ';'s in the + EMAIL attributes for mailing lists. + 2004-01-22 Chris Toshok [ fixes bug #52944 ] diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c index 60b87d4dd6..1514e72434 100644 --- a/addressbook/gui/component/addressbook-migrate.c +++ b/addressbook/gui/component/addressbook-migrate.c @@ -283,6 +283,36 @@ migrate_contacts (EBook *old_book, EBook *new_book) "VOICE"); attr = attr->next; } + /* this is kinda gross. The new vcard parser + needs ';'s to be escaped by \'s. but the + 1.4 vcard generator would put unescaped xml + (including entities like >) in the value + of attributes, so we need to go through and + escape those ';'s. */ + else if (!strcmp ("EMAIL", e_vcard_attribute_get_name (a))) { + GList *v = e_vcard_attribute_get_values (a); + + if (v && v->data) { + if (!strncmp ((char*)v->data, "data); + if (v->next) + g_string_append_c (str, ';'); + v = v->next; + } + + e_vcard_attribute_remove_values (a); + e_vcard_attribute_add_value (a, str->str); + g_string_free (str, TRUE); + } + } + + attr = attr->next; + } else { attr = attr->next; } -- cgit v1.2.3