aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-08 01:53:15 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-08 01:53:15 +0200
commitc7e3c88edaca45fa315602db5a3d296cf1e6a07f (patch)
treed3afce4f1e2f16faea5315f17da9f3e842eddb36
parentHTML move download to own tab. (diff)
downloadcalp-c7e3c88edaca45fa315602db5a3d296cf1e6a07f.tar.gz
calp-c7e3c88edaca45fa315602db5a3d296cf1e6a07f.tar.xz
Fixes in add-event.
-rw-r--r--module/vcomponent.scm9
1 files changed, 5 insertions, 4 deletions
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<?)))
+ (setf 'repeating-events (insert-ordered event repeating ev-time<?)))
(let ((regular (getf 'fixed-events)))
(setf 'fixed-events (insert-ordered event regular ev-time<?))))