Bug 697859 - Google: "Other Fax" is saved as "Business Fax"
authorMatthew Barnes <mbarnes@redhat.com>
Wed, 8 May 2013 14:48:03 +0000 (10:48 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Wed, 8 May 2013 14:48:03 +0000 (10:48 -0400)
The gd:phoneNumber @rel value "http://schemas.google.com/g/2005#fax"
has no clear mapping to an EContact field.

Both it and "http://schemas.google.com/g/2005#other_fax" end up in a
vCard as TEL;TYPE=fax.  But because of the conversion table ordering,
TEL;TYPE=fax was being saved as "#fax" instead of "#other_fax".

Then when reading the contact back from Google, I guess some fallback
logic somewhere was converting "#fax" to "TEL;TYPE="work,fax".  Never
found exactly where that was happening.  Maybe in the Contact Editor?

This commit reorders the conversion table to prefer "#other_fax" over
"#fax".  There's still a conflict where if a Google contact specifies
both "#fax" and "#other_fax" one of the fax numbers may be lost.  But
honestly, who has that many fax machines nowadays?

addressbook/backends/google/e-book-google-utils.c

index a1efac9..1739411 100644 (file)
@@ -904,7 +904,6 @@ static const struct RelTypeMap rel_type_map_phone[] = {
        { "callback", { EVC_X_CALLBACK, NULL }},
        { "car", { "CAR", NULL }},
        { "company_main", {EVC_X_COMPANY, NULL }},
-       { "fax", { "FAX", NULL }},
        { "isdn", { "ISDN", NULL }},
        { "main", { "PREF", NULL }},
        { "mobile", { "CELL", NULL }},
@@ -913,7 +912,12 @@ static const struct RelTypeMap rel_type_map_phone[] = {
        { "pager", { "PAGER", NULL }},
        { "radio", { EVC_X_RADIO, NULL }},
        { "telex", { EVC_X_TELEX, NULL }},
-       { "tty_tdd", { EVC_X_TTYTDD, NULL }}
+       { "tty_tdd", { EVC_X_TTYTDD, NULL }},
+
+       /* XXX This has no clear mapping to an EContact field.
+        *     It's listed here for completeness, but ordered
+        *     last so that "other_fax" is preferred. */
+       { "fax", { "FAX", NULL }}
 };
 
 static const struct RelTypeMap rel_type_map_im[] = {