aboutsummaryrefslogtreecommitdiff
path: root/module/output/ical.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-06-05 21:48:11 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-06-05 21:48:11 +0200
commitb62ae7068837b18e83948abd1685f5b1b2da52d7 (patch)
treec8685c1b42dc089e41b8c93dadb15828092427a1 /module/output/ical.scm
parentRemove incorrect output of DURATION. (diff)
downloadcalp-b62ae7068837b18e83948abd1685f5b1b2da52d7.tar.gz
calp-b62ae7068837b18e83948abd1685f5b1b2da52d7.tar.xz
Filter out ALL X-HNH- fields from ics output.
Diffstat (limited to 'module/output/ical.scm')
-rw-r--r--module/output/ical.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/module/output/ical.scm b/module/output/ical.scm
index 02dd5d64..fd4091ed 100644
--- a/module/output/ical.scm
+++ b/module/output/ical.scm
@@ -97,6 +97,11 @@
(ical-line-fold (string-drop string wrap-len)))]
[else string]))
+(define* (internal-field? symbol optional: (prefix "X-HNH-"))
+ (string=? prefix
+ (string-take-to (symbol->string symbol)
+ (string-length prefix))))
+
(define-public (component->ical-string component)
(format #t "BEGIN:~a\r\n" (type component))
;; TODO this leaks internal information,
@@ -105,11 +110,8 @@
;; Special cases depending on key.
;; Value formatting is handled in @code{value-format}.
(match-lambda*
- ;; Handled below
- [('X-HNH-ALTERNATIVES _) 'noop]
- ;; Remove from output
- [('X-HNH-FILENAME _) 'noop]
+ [(? (compose internal-field? car)) 'noop]
[(key (vlines ...))
(for vline in vlines