Il giorno lun, 27/02/2006 alle 13.29 +0100, Nabil Sayegh ha scritto:
> Am Montag, 27. Februar 2006 12:45 schrieb Sergio CERLESi:
> > It's a Evolution problem, it handles only "OTHER" and not "POSTAL".
> >
> > However my ipaq report "other address" and I think that "OTHER" and
> > "POSTAL" are both right values, this isn't only a workaround.
> >
> > So, if Kaddressbook handles both "POSTAL" and "OTHER" fine, with this
> > patch I fix little problem for Evolution users.
> >
> > What do you thing about ?
> > You thing that aren't a good idea ?
> 
> AFAICS kabc handles only:
>  dom
>  home
>  intl
>  parcel
>  postal
>  work
> 
> Though it will be displayed coorectly, it's not possible to add a new address 
> with type "other".
> 
> We need a mechanism that maps fields of the various PIMs to the fields of the 
> device. Not only for addresses, but also for custom fields like ICQ etc.
> 
> Any help in this direction would be greatly appreciated.
> 
> rgds

Hi Nabil,

what do you think about the attached patch,

I looked into rfc2426 (http://www.faqs.org/rfcs/rfc2426.html) and both
of the follow syntax are correct:

"ADR;TYPE=OTHER;TYPE=POSTAL:;;"

"ADR;TYPE=OTHER,POSTAL:;;"

Any suggestions are welcome. 

Sergio

--- ./lib/contact.c.Orig	2006-02-27 10:39:49.000000000 +0100
+++ ./lib/contact.c	2006-02-27 14:25:15.000000000 +0100
@@ -651,7 +651,7 @@ static bool rra_contact_to_vcard2(/*{{{*
         extended++[-1] = '\0';
     }
 
-		strbuf_append_type(vcard, "ADR", "POSTAL", flags);
+		strbuf_append              (vcard, "ADR;TYPE=OTHER;TYPE=POSTAL;:");
 		strbuf_append_escaped_wstr (vcard, NULL, flags); /* post office box */
 		strbuf_append_c            (vcard, ';');
     strbuf_append_escaped      (vcard, extended, flags); /* extended address */
@@ -1141,17 +1141,12 @@ static bool parser_handle_field(/*{{{*/
 		char** address = strsplit(value, ';');
 		int where;
 
-		if (STR_IN_STR(type, "POSTAL"))
-		        where = OTHER;
-		else if (STR_IN_STR(type, "WORK"))
+    if (STR_IN_STR(type, "WORK"))
 			where = WORK;
 		else if (STR_IN_STR(type, "HOME"))
 			where = HOME;
 		else
-		{
-			synce_warning("Unknown address type: '%s'", type);
-			goto exit;
-		}
+      where = OTHER;
 		
 		strv_dump(address);
 		

Reply via email to