aboutsummaryrefslogtreecommitdiff
path: root/modules/calendar-sync.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-25 00:10:02 -0400
committerCraig Jennings <c@cjennings.net>2026-06-25 00:10:02 -0400
commit2c00d2067217fd4278f8528d45c9e7c53fa330ea (patch)
treec5bacbcf24ad9bde1a03ef43b50b2fafec823c8b /modules/calendar-sync.el
parent372b4ee38bc048da98946e51f1bce5c21ce935bd (diff)
downloaddotemacs-2c00d2067217fd4278f8528d45c9e7c53fa330ea.tar.gz
dotemacs-2c00d2067217fd4278f8528d45c9e7c53fa330ea.zip
fix(calendar-sync): re-derive status from a declined occurrence override
A recurring event declined for one occurrence still synced with :STATUS: accepted, because apply-single-exception merged the override attendees but never re-derived the user's status from them, so filter-declined never dropped it. Re-derive :status via find-user-status when the exception overrides :attendees, leaving the inherited status when the override doesn't name the user. Four new tests cover declined, accepted, no-attendee, and user-absent overrides.
Diffstat (limited to 'modules/calendar-sync.el')
-rw-r--r--modules/calendar-sync.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el
index ce1f063a..1a8ea153 100644
--- a/modules/calendar-sync.el
+++ b/modules/calendar-sync.el
@@ -540,7 +540,15 @@ Compares year, month, day, hour, minute."
(plist-put result :location (plist-get exception :location)))
;; Pass through new fields if exception overrides them
(when (plist-get exception :attendees)
- (plist-put result :attendees (plist-get exception :attendees)))
+ (plist-put result :attendees (plist-get exception :attendees))
+ ;; Re-derive the user's status from the overridden attendees so a
+ ;; singly-declined occurrence drops its inherited series "accepted"
+ ;; (otherwise `calendar-sync--filter-declined' can't drop it). Leave the
+ ;; inherited status when the override doesn't name the user.
+ (let ((status (calendar-sync--find-user-status
+ (plist-get exception :attendees) calendar-sync-user-emails)))
+ (when status
+ (plist-put result :status status))))
(when (plist-get exception :organizer)
(plist-put result :organizer (plist-get exception :organizer)))
(when (plist-get exception :url)