Skip to contentSkip to conversation

Fix handling vCard type "OTHER" emails in PBAP

PATCH In review Bartosz Szatkowski 2 participants 2 messages Aug 5, 2011 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix handling vCard type "OTHER" emails in PBAP

Until now contacts with emails, without type specified, were not included in vCards. Also default type for vCard 3.0 is set to "OTHER" - not empty field as it is in vCard 2.1.

---
 plugins/phonebook-tracker.c |    6 +++---
 plugins/vcard.c             |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
plugins/phonebook-tracker.c +3 -3
index 3ac1c44..8bc070f 100644
@@ -129,7 +129,7 @@
 "nco:fullname(nco:org(?_role))"						\
 "nco:department(?_role) "						\
 "(SELECT GROUP_CONCAT(fn:concat(?emailaddress,\"\31\","			\
-	"rdfs:label(?_role)),"						\
+	"tracker:coalesce(rdfs:label(?_role), \"\")),"			\
 	"\"\30\") "							\
 	"WHERE { "							\
 	"?_role nco:hasEmailAddress "					\
@@ -241,7 +241,7 @@ CALLS_CONSTRAINTS(CONSTRAINT)						\
 	"nco:fullname(nco:org(?_role)) "				\
 	"nco:department(?_role) "					\
 "(SELECT GROUP_CONCAT(fn:concat(?emailaddress,\"\31\","			\
-	"rdfs:label(?c_role)),"						\
+	"tracker:coalesce(rdfs:label(?c_role), \"\")),"			\
 	"\"\30\") "							\
 	"WHERE { "							\
 	"?_contact nco:hasAffiliation ?c_role . "			\
@@ -334,7 +334,7 @@ COMBINED_CONSTRAINT		\
 "nco:fullname(nco:org(?_role))"						\
 "nco:department(?_role) "						\
 "(SELECT GROUP_CONCAT(fn:concat(?emailaddress,\"\31\","			\
-	"rdfs:label(?_role)),"						\
+	"tracker:coalesce(rdfs:label(?_role), \"\")),"			\
 	"\"\30\") "							\
 	"WHERE { "							\
 	"?_role nco:hasEmailAddress "					\
plugins/vcard.c +1 -1
index 4d12687..5a5bcf4 100644
@@ -368,7 +368,7 @@ static void vcard_printf_email(GString *vcards, uint8_t format,
 		if (format == FORMAT_VCARD21)
 			category_string = "INTERNET";
 		else if (format == FORMAT_VCARD30)
-			category_string = "TYPE=INTERNET";
+			category_string = "TYPE=INTERNET;TYPE=OTHER";
 	}
 
 	add_slash(field, address, LEN_MAX, len);
Signature · 1 line
1.7.4.1
#1 lore raw

Hi Bartosz,

Quoted 7 lines · Bartosz Szatkowski

Until now contacts with emails, without type specified, were not included in vCards. Also default type for vCard 3.0 is set to "OTHER" - not empty field as it is in vCard 2.1.

---
 plugins/phonebook-tracker.c |    6 +++---
 plugins/vcard.c             |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Pushed upstream. Thanks.

Johan