vcard.patch 985 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 @@
Gaetan Bisson's avatar
Gaetan Bisson committed
16
17
18
19
20
21
22
23
 	// vCard(the country name)
 	item_fput(item, COUNTRY, xstrdup(strsep(&value, ";")));
 
-	if(*value) xfree(value);
+	if(value) xfree(value);
 }
 
 static void
24
@@ -2052,6 +2053,13 @@
Gaetan Bisson's avatar
Gaetan Bisson committed
25
26
27
28
29
30
31
 
 	free(name);
 
+	if(db_fget(item, NICK))
+	  fprintf(out, "NICKNAME:%s\r\n",
+		  safe_str(db_fget(item, NICK)));
+	if(db_fget(item, ANNIVERSARY))
32
+	  fprintf(out, "BDAY:%s\r\n",
Gaetan Bisson's avatar
Gaetan Bisson committed
33
34
35
36
37
+		  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",