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
commitfdcaae5a481a98a8d9348c899cf249e06880c710 (patch)
tree6926015dd086532e7730b4a601e9998416219d3e /modules/calendar-sync.el
parentff4fbc99eafb90b62763923170abc6e6a6ffd14a (diff)
downloaddotemacs-fdcaae5a481a98a8d9348c899cf249e06880c710.tar.gz
dotemacs-fdcaae5a481a98a8d9348c899cf249e06880c710.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 8d7552d3e..7ed14921f 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)