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
This commit is contained in:
Marcel van der Boom 2022-08-25 21:00:09 +02:00 committed by Dirk-Jan C. Binnema
parent 0fd9020726
commit 41c7c6b0d5
1 changed files with 10 additions and 9 deletions

View File

@ -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