From 41c7c6b0d598ac18faff421cb5395723666587e4 Mon Sep 17 00:00:00 2001 From: Marcel van der Boom Date: Thu, 25 Aug 2022 21:00:09 +0200 Subject: [PATCH] Fix empty 'To:' header on reply to icalendar invitation On reply to an ical invitation the To: header stayed empty, this fixes that. The 'Reply-To' data is set if it is not there and if the emaill was different from the Organizer so that the msg can be further treated by the draft construct functions. This issue is briefly mentioned in issue #2305 --- mu4e/mu4e-icalendar.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mu4e/mu4e-icalendar.el b/mu4e/mu4e-icalendar.el index 2bc4ce03..929d188a 100644 --- a/mu4e/mu4e-icalendar.el +++ b/mu4e/mu4e-icalendar.el @@ -136,18 +136,19 @@ (mu4e-sent-messages-behavior 'delete) (mu4e-compose-reply-recipients 'sender) (ical-msg (cl-copy-list msg))) - ;; Make sure the reply is sent to the organiser. + ;; Make sure the reply is sent to email of the organiser with proper name. (let* ((organizer (gnus-icalendar-event:organizer event)) - (reply-to (plist-get msg :reply-to)) - (name (or (caar reply-to) - (caar (plist-get msg :from)))) - (email (cons name organizer))) + (reply-to (car (plist-get msg :reply-to))) + (from (car (plist-get msg :from))) + (name (or (plist-get reply-to :name) + (plist-get from :name)))) + ;; Add :reply-to field when incomplete or absent (unless (or (string= organizer "") (mu4e~icalendar-has-email organizer reply-to)) - (plist-put ical-msg :reply-to (cons email reply-to)))) - (plist-put ical-msg :subject - (concat (capitalize (symbol-name status)) - ": " (gnus-icalendar-event:summary event))) + (plist-put ical-msg :reply-to `((:name ,name :email ,organizer)))) + (plist-put ical-msg :subject + (concat (capitalize (symbol-name status)) + ": " (gnus-icalendar-event:summary event)))) (mu4e~compose-handler 'reply ical-msg `((:buffer-name ,ical-name