[evolution-data-server/gnome-40] I#316 - vCard: PHOTO/LOGO is a single value attribute
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-40] I#316 - vCard: PHOTO/LOGO is a single value attribute
- Date: Fri, 19 Mar 2021 08:28:21 +0000 (UTC)
commit 051763658b82b48749177451237e8771d2bbc687
Author: Milan Crha <mcrha redhat com>
Date: Fri Mar 19 09:26:38 2021 +0100
I#316 - vCard: PHOTO/LOGO is a single value attribute
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/316
src/addressbook/libebook-contacts/e-vcard.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/addressbook/libebook-contacts/e-vcard.c b/src/addressbook/libebook-contacts/e-vcard.c
index 24dd5a7f3..6c971e50c 100644
--- a/src/addressbook/libebook-contacts/e-vcard.c
+++ b/src/addressbook/libebook-contacts/e-vcard.c
@@ -210,6 +210,18 @@ e_vcard_attribute_new_take (gchar *attr_group,
return attr;
}
+static gboolean
+e_vcard_attribute_is_singlevalue_type (EVCardAttribute *attr)
+{
+ g_return_val_if_fail (attr != NULL, FALSE);
+
+ return g_ascii_strcasecmp (attr->name, EVC_KEY) == 0 ||
+ g_ascii_strcasecmp (attr->name, EVC_LOGO) == 0 ||
+ g_ascii_strcasecmp (attr->name, EVC_PHOTO) == 0 ||
+ g_ascii_strcasecmp (attr->name, "SOUND") == 0 ||
+ g_ascii_strcasecmp (attr->name, "TZ") == 0;
+}
+
/* Case insensitive version of strstr */
static gchar *
strstr_nocase (const gchar *haystack,
@@ -431,7 +443,7 @@ read_attribute_value (EVCardAttribute *attr,
}
lp = g_utf8_next_char (lp);
}
- else if ((*lp == ';') ||
+ else if ((*lp == ';' && !e_vcard_attribute_is_singlevalue_type (attr)) ||
(*lp == ',' && !g_ascii_strcasecmp (attr->name, "CATEGORIES"))) {
WRITE_CHUNK ();
if (charset) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]