]> git.eshelyaron.com Git - emacs.git/commitdiff
reply to the organizer of an ical event
authorAlexandre Duret-Lutz <adl@lrde.epita.fr>
Wed, 22 Sep 2021 14:30:21 +0000 (16:30 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 1 Oct 2021 12:07:16 +0000 (14:07 +0200)
RFC5546 specifies that participant status (accepted, tentative,
declined) should be sent to the organizer of the event.  That
organizer is not necessarily the sender of the invitation; for
instance Google Calendar uses custom email addresses to receive these
notifications.

* lisp/gnus/gnus-icalendar.el (gnus-icalendar-send-buffer-by-mail):
Replace the default recipient of the reply by the organizer of the
event.
(gnus-icalendar-reply) Pass that organizer to the previous function.

lisp/gnus/gnus-icalendar.el

index b6e5e7f786a5e53ac7c44d93a20f30a1815e54b1..514feff284713e177965d4e6b0278517ee996b85 100644 (file)
@@ -847,10 +847,14 @@ These will be used to retrieve the RSVP information from ical events."
        button t
        gnus-data ,data))))
 
-(defun gnus-icalendar-send-buffer-by-mail (buffer-name subject)
+(defun gnus-icalendar-send-buffer-by-mail (buffer-name subject organizer)
   (let ((message-signature nil))
     (with-current-buffer gnus-summary-buffer
       (gnus-summary-reply)
+      ;; Reply to the organizer, not to whoever sent the invitation. person
+      ;; Some calendar systems use specific email address as organizer to
+      ;; receive these responses.
+      (message-replace-header "To" organizer)
       (message-goto-body)
       (mml-insert-multipart "alternative")
       (mml-insert-empty-tag 'part 'type "text/plain")
@@ -866,7 +870,8 @@ These will be used to retrieve the RSVP information from ical events."
          (event (caddr data))
          (reply (gnus-icalendar-with-decoded-handle handle
                   (gnus-icalendar-event-reply-from-buffer
-                   (current-buffer) status (gnus-icalendar-identities)))))
+                   (current-buffer) status (gnus-icalendar-identities))))
+         (organizer (gnus-icalendar-event:organizer event)))
 
     (when reply
       (cl-labels
@@ -883,7 +888,7 @@ These will be used to retrieve the RSVP information from ical events."
             (delete-region (point-min) (point-max))
             (insert reply)
             (fold-icalendar-buffer)
-            (gnus-icalendar-send-buffer-by-mail (buffer-name) subject))
+            (gnus-icalendar-send-buffer-by-mail (buffer-name) subject organizer))
 
           ;; Back in article buffer
           (setq-local gnus-icalendar-reply-status status)