From 1df15b2ceaef09b48a39aa6046b577da11ea2f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 26 Nov 2021 15:32:41 +0100 Subject: Got categories working. --- module/vcomponent/xcal/parse.scm | 43 +++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'module/vcomponent') diff --git a/module/vcomponent/xcal/parse.scm b/module/vcomponent/xcal/parse.scm index 124a91f4..48ce301e 100644 --- a/module/vcomponent/xcal/parse.scm +++ b/module/vcomponent/xcal/parse.scm @@ -171,11 +171,25 @@ ;; ignore empty fields ;; mostly for (unless (null? value) - (set! (prop* component tag*) - (make-vline tag* - (handle-tag - tag (handle-value type params value)) - params)))))] + (let () + (define vline + (make-vline tag* + (handle-tag + tag (handle-value type params value)) + params)) + (if (memv tag* '(ATTACH ATTENDEE CATEGORIES + COMMENT CONTACT EXDATE + REQUEST-STATUS RELATED-TO + RESOURCES RDATE + ;; x-prop + ;; iana-prop + )) + (aif (prop* component tag*) + (set! (prop* component tag*) (cons vline it)) + (set! (prop* component tag*) (list vline))) + ;; else + (set! (prop* component tag*) vline)) + ))))] [(tag (type value ...) ...) (for (type value) in (zip type value) @@ -184,7 +198,7 @@ (unless (null? value) (let ((params (make-hash-table)) (tag* (symbol-upcase tag))) - (set! (prop* component tag*) + (define vline (make-vline tag* (handle-tag tag (let ((v (handle-value type params value))) @@ -192,7 +206,22 @@ (if (eq? tag 'categories) (string-split v #\,) v))) - params)))))]))) + params)) + ;; + + (if (memv tag* '(ATTACH ATTENDEE CATEGORIES + COMMENT CONTACT EXDATE + REQUEST-STATUS RELATED-TO + RESOURCES RDATE + ;; x-prop + ;; iana-prop + )) + (aif (prop* component tag*) + (set! (prop* component tag*) (cons vline it)) + (set! (prop* component tag*) (list vline))) + ;; else + (set! (prop* component tag*) vline)) + )))]))) ;; children (awhen (assoc-ref sxcal 'components) -- cgit v1.2.3