aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-01-23 07:44:35 +0800
committerChris Toshok <toshok@src.gnome.org>2004-01-23 07:44:35 +0800
commit93e268731dad2c7529879ac99aef1e1ab216463d (patch)
treed3e8187bed29a4aec750ebc4e4b4a38e972caa67 /addressbook/gui
parentc9b56375fe7b21673fd813d3e957b64fe6f9f7f0 (diff)
downloadgsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.tar
gsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.tar.gz
gsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.tar.bz2
gsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.tar.lz
gsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.tar.xz
gsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.tar.zst
gsoc2013-evolution-93e268731dad2c7529879ac99aef1e1ab216463d.zip
[ fixes bug #53184 ] handle the fact that the xml 1.4 spits out contains
2004-01-22 Chris Toshok <toshok@ximian.com> [ 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
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook-migrate.c30
1 files changed, 30 insertions, 0 deletions
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 &gt;) 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, "<?xml", 5)) {
+ /* k, this is the nasty part. we glomb all the
+ value strings back together again (if there is
+ more than one), then work our magic */
+ GString *str = g_string_new ("");
+ while (v) {
+ g_string_append (str, v->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;
}