about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJake Coble2025-06-07 18:26:56 -0400
committerArun Isaac2025-06-08 03:07:59 +0100
commit2c9130bf951a84a848c09c8d07d867ebeb8a63b4 (patch)
tree88fcca4bd3d26d93c2c09a1ec906aa37920681a6
parenta50bd935df695e1f6e720761cba39c34af0c1cda (diff)
downloadvaruga-2c9130bf951a84a848c09c8d07d867ebeb8a63b4.tar.gz
varuga-2c9130bf951a84a848c09c8d07d867ebeb8a63b4.tar.lz
varuga-2c9130bf951a84a848c09c8d07d867ebeb8a63b4.zip
Add all recipients as required attendees.
* varuga.el: Require emacs 27.1 for message-all-recipients.
(varuga-calendar-event): Add attendees field.
(varuga-invite): Initialize attendees field.
(varuga-insert-calendar-event): Serialize attendees field.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
-rw-r--r--varuga.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/varuga.el b/varuga.el
index 2b6776d..f06131b 100644
--- a/varuga.el
+++ b/varuga.el
@@ -7,7 +7,7 @@
 ;; Author: Arun Isaac <arunisaac@systemreboot.net>
 ;; Version: 0.1.0
 ;; Homepage: https://git.systemreboot.net/varuga
-;; Package-Requires: ((emacs "26.1"))
+;; Package-Requires: ((emacs "27.1"))
 
 ;; This file is part of varuga.
 
@@ -62,7 +62,8 @@
   time-start
   time-end
   summary
-  location)
+  location
+  attendees)
 
 (defvar varuga-product-identifier
   "-//systemreboot//varuga//NONSGML v1.0//EN")
@@ -121,6 +122,16 @@ PARAMS is an alist of ical property parameters and their values."
                                (format "MAILTO:%s"
                                        (varuga-calendar-event-organizer-email-address event))
                                `((cn . ,(varuga-calendar-event-organizer event))))
+  (seq-do (pcase-lambda (`(,name ,address))
+            (let ((properties `((role . "REQ-PARTICIPANT")
+                                (rsvp . "TRUE"))))
+              (varuga-insert-calendar-line 'attendee
+                                           (format "MAILTO:%s" address)
+                                           (if name
+                                               (cons `(cn . ,name)
+                                                     properties)
+                                             properties))))
+          (varuga-calendar-event-attendees event))
   (varuga-insert-calendar-line 'dtstart
                                (varuga-format-time-string
                                 (varuga-calendar-event-time-start event)))
@@ -198,7 +209,8 @@ is the length of the event in minutes."
                             :time-end (time-add when
                                                 (* 60 (org-duration-to-minutes duration)))
                             :summary summary
-                            :location location))))))
+                            :location location
+                            :attendees (message-all-recipients)))))))
     (insert "<#/multipart>\n")))
 
 (provide 'varuga)