From c7e3c88edaca45fa315602db5a3d296cf1e6a07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 8 Jul 2020 01:53:15 +0200 Subject: Fixes in add-event. --- module/vcomponent.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/vcomponent.scm b/module/vcomponent.scm index 2eb4ef2c..de816886 100644 --- a/module/vcomponent.scm +++ b/module/vcomponent.scm @@ -66,21 +66,22 @@ ;;; TODO vcomponent should NOT depend on output (use-modules (output ical)) +;;; TODO what should happen when an event with that UID already exists +;;; in the calendar? Fail? Overwrite? Currently it adds a second element +;;; with the same UID, which is BAD. (define-public (add-event calendar event) (add-child! calendar event) - (getf 'uid-map) - (unless (prop event 'UID) (set! (prop event 'UID) (uuidgen))) (let ((events (getf 'events))) - (setf 'events (cons event events))) + (setf 'events (cons event events))) (if (repeating? event) (let ((repeating (getf 'repeating-events))) - (setf 'repeating-events (insert-ordered repeating ev-time