Skip to content

Commit

Permalink
Collect UIDs in a table in the vcalendar class
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Mar 19, 2012
1 parent 1fb8687 commit a2d7847
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components.lisp
Expand Up @@ -459,13 +459,24 @@ then the other must so." valarm))
(once "LAST-MODIFIED" "TZURL"))

;;; VCALENDAR
(declare-component vcalendar)

(defclass vcalendar (standard-component)
((uid-table
:initform (make-hash-table :test #'equalp)
:reader uid-table)))

(define-component vcalendar
((:allow-x-components . t)
(:subcomponents vtodo vevent vjournal vfreebusy vtimezone))
(required "PRODID" "VERSION")
(once "CALSCALE" "METHOD"))

(defmethod add-subcomponent-to-component :after
((event vevent) (component vcalendar))
(let ((uid (query-property event "UID")))
(when uid
(setf (gethash (property-value uid) (uid-table component)) event))))


(defmethod initialize-component ((component vcalendar) &key
(version "2.0")
Expand Down

0 comments on commit a2d7847

Please sign in to comment.