From 0f92c27e65e912fdd0cde24c64bbb33e633c7454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 1 May 2019 16:49:27 +0200 Subject: X-WR-CALNAME and COLOR attr in VCALENDAR now respected. --- module/vcomponent.scm | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/module/vcomponent.scm b/module/vcomponent.scm index c6fe2104..e052f97e 100644 --- a/module/vcomponent.scm +++ b/module/vcomponent.scm @@ -159,9 +159,15 @@ ;; TODO the other VCALENDAR components might not get thrown away, ;; this since I protect them from the GC in the C code. ((vdir) - (let ((accum (make-vcomponent))) + (let ((accum (make-vcomponent)) + (ch (children root))) (set! (type accum) "VCALENDAR") - (for cal in (children root) + + (unless (null? ch) + (for key in (attributes (car ch)) + (set! (attr accum key) (attr (car ch) key)))) + + (for cal in ch (for component in (children cal) (case (type component) ((VTIMEZONE) @@ -180,10 +186,14 @@ (parse-dates! component) - (set! (attr component "NAME") - (attr root "NAME")) - (set! (attr component "COLOR") - (attr root "COLOR")) + (unless (attr component "NAME") + (set! (attr component "NAME") + (or (attr component "X-WR-CALNAME") + (attr root "NAME")))) + + (unless (attr component "COLOR") + (set! (attr component "COLOR") + (attr root "COLOR"))) ;; return component))) -- cgit v1.2.3