From 41864407018fedd409811621041aab12153cc89a Mon Sep 17 00:00:00 2001 From: Gaetan Bisson Date: Tue, 26 Nov 2013 21:34:11 +0100 Subject: [PATCH] vcard built-in import: support of the BDAY (anniversary) vcard field vcard export: output BDAY and NICK vcard fields --- filter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/filter.c b/filter.c index 7f8bcd5..dca51b8 100644 --- a/filter.c +++ b/filter.c @@ -1557,8 +1557,9 @@ static char *vcard_fields[] = { "NICKNAME", /* NICK */ "URL", /* URL */ "NOTE", /* NOTES */ + "BDAY", /* ANNIVERSARY */ "N", /* NAME: special case/mapping in vcard_parse_line() */ - NULL /* not implemented: ANNIVERSARY, ITEM_FIELDS */ + NULL /* ITEM_FIELDS */ }; enum { @@ -2065,6 +2066,13 @@ vcard_export_item(FILE *out, int item) 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", -- 2.39.2