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
commit701d4b0df760874dbc0c9cca4bfc2a1bf0059ea1 (patch)
tree866235439329bf65f5ef7c6f596b061fe79652da /modules/calendar-sync.el
parent75beeb556188e06a139e0a006b44a27671763907 (diff)
downloaddotemacs-701d4b0df760874dbc0c9cca4bfc2a1bf0059ea1.tar.gz
dotemacs-701d4b0df760874dbc0c9cca4bfc2a1bf0059ea1.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)