]> git.deb.at Git - pkg/abook.git/commitdiff
vcard built-in import: support of the BDAY (anniversary) vcard field
authorGaetan Bisson <bisson@archlinux.org>
Tue, 26 Nov 2013 20:34:11 +0000 (21:34 +0100)
committerRaphaël Droz <raphael.droz+floss@gmail.com>
Tue, 26 Nov 2013 20:35:26 +0000 (21:35 +0100)
vcard export: output BDAY and NICK vcard fields

filter.c

index 7f8bcd5ce3da16f61d61fa0b670b8ae44dbbc1e6..dca51b804e79495580c3af03dedfcf477e7a0cf4 100644 (file)
--- 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",