summaryrefslogtreecommitdiff
path: root/extra/abook/vcard.patch
blob: f2e93a9401567c2c3febcbe21cd5c5b9648ec059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -aur old/filter.c new/filter.c
--- old/filter.c	2013-10-10 16:04:46.230433845 -1000
+++ new/filter.c	2013-10-10 16:40:07.014569795 -1000
@@ -1557,8 +1557,9 @@
 	"NICKNAME",		/* NICK */
 	"URL",			/* URL */
 	"NOTE",			/* NOTES */
+	"BDAY",			/* ANNIVERSARY */
 	"N",			/* NAME: special case/mapping in vcard_parse_line() */
-	NULL			/* not implemented: ANNIVERSARY, ITEM_FIELDS */
+	NULL			/* not implemented: ITEM_FIELDS */
 };
 
 enum {
@@ -1673,7 +1674,7 @@
 	// vCard(the country name)
 	item_fput(item, COUNTRY, xstrdup(strsep(&value, ";")));
 
-	if(*value) xfree(value);
+	if(value) xfree(value);
 }
 
 static void
@@ -2052,6 +2053,13 @@
 
 	free(name);
 
+	if(db_fget(item, NICK))
+	  fprintf(out, "NICKNAME:%s\r\n",
+		  safe_str(db_fget(item, NICK)));
+	if(db_fget(item, ANNIVERSARY))
+	  fprintf(out, "BDAY:%s\r\n",
+		  safe_str(db_fget(item, ANNIVERSARY)));
+
 	// see rfc6350 section 6.3.1
 	if(db_fget(item, ADDRESS)) {
 		fprintf(out, "ADR:;%s;%s;%s;%s;%s;%s\r\n",