aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook-migrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/component/addressbook-migrate.c')
-rw-r--r--addressbook/gui/component/addressbook-migrate.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c
index ae50765225..859b71103f 100644
--- a/addressbook/gui/component/addressbook-migrate.c
+++ b/addressbook/gui/component/addressbook-migrate.c
@@ -300,6 +300,31 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book)
"VOICE");
attr = attr->next;
}
+ /* Replace "POSTAL" (1.4) addresses with "OTHER" (1.5) */
+ else if (!strcmp ("ADR", e_vcard_attribute_get_name (a))) {
+ GList *params, *param;
+ gboolean found = FALSE;
+ EVCardAttributeParam *p;
+
+ params = e_vcard_attribute_get_params (a);
+ for (param = params; param; param = param->next) {
+ p = param->data;
+ if (!strcmp (EVC_TYPE, e_vcard_attribute_param_get_name (p))) {
+ GList *v = e_vcard_attribute_param_get_values (p);
+ if (v && v->data && !strcmp ("POSTAL", v->data)) {
+ found = TRUE;
+ break;
+ }
+ }
+ }
+
+ if (found) {
+ e_vcard_attribute_param_remove_values (p);
+ e_vcard_attribute_param_add_value (p, "OTHER");
+ }
+
+ 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