Handing encoding type "BASE64" and forming FN from N when FN is not
authorSushma Rai <rsushma@src.gnome.org>
Fri, 6 May 2005 05:08:01 +0000 (05:08 +0000)
committerSushma Rai <rsushma@src.gnome.org>
Fri, 6 May 2005 05:08:01 +0000 (05:08 +0000)
present. Fixes #268271.

addressbook/ChangeLog
addressbook/libebook/e-contact.c
addressbook/libebook/e-vcard.c

index 97d2b40..d20c2cc 100644 (file)
@@ -1,5 +1,14 @@
 2005-05-06  Sushma Rai  <rsushma@novell.com>
 
+       * libebook/e-vcard.c (e_vcard_attribute_add_param): Handling encoding
+       type BASE64.
+
+       * libebook/e-contact.c (n_getter): If FN attribute is not present, 
+       forming FN value from N and adding it to the vcard.
+       Fixes #268271
+
+2005-05-06  Sushma Rai  <rsushma@novell.com>
+
        * libedata-book/e-book-backend-cache.c
        (e_book_backend_cache_get_contacts): Freeing the list of cache objects
        and sexp.
index ba44fe1..7e4fef9 100644 (file)
@@ -463,6 +463,9 @@ static void*
 n_getter (EContact *contact, EVCardAttribute *attr)
 {
        EContactName *name = g_new0 (EContactName, 1);
+       EVCardAttribute *new_attr;
+       char *name_str;
+
        if (attr) {
                GList *p = e_vcard_attribute_get_values (attr);
 
@@ -473,6 +476,15 @@ n_getter (EContact *contact, EVCardAttribute *attr)
                name->suffixes   = g_strdup (p && p->data ? p->data : "");
        }
 
+       new_attr = e_contact_get_first_attr (contact, EVC_FN);
+       if (!new_attr) {
+               new_attr = e_vcard_attribute_new (NULL, EVC_FN);
+               e_vcard_add_attribute (E_VCARD (contact), new_attr);
+               name_str = e_contact_name_to_string (name);
+               e_vcard_attribute_add_value (new_attr, name_str);
+               g_free (name_str);
+       }
+
        return name;
 }
 
index 67f7c24..340b320 100644 (file)
@@ -1334,7 +1334,8 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
                }
 
                if (param->values && param->values->data) {
-                       if (!g_ascii_strcasecmp ((char*)param->values->data, "b"))
+                       if (!g_ascii_strcasecmp ((char*)param->values->data, "b") ||
+                           !g_ascii_strcasecmp ((char*)param->values->data, "BASE64"))
                                attr->encoding = EVC_ENCODING_BASE64;
                        else if (!g_ascii_strcasecmp ((char*)param->values->data, EVC_QUOTEDPRINTABLE))
                                attr->encoding = EVC_ENCODING_QP;