aboutsummaryrefslogtreecommitdiff
path: root/chime.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 05:15:59 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 05:15:59 -0500
commite4a254453dedacafcca883a3b20302762c872280 (patch)
tree03c4bfdd3384ab0dba34017e9b7b7dffe12aad41 /chime.el
parentfda1e989e0c22433b0214ab537a61852d906fd4b (diff)
downloadchime-e4a254453dedacafcca883a3b20302762c872280.tar.gz
chime-e4a254453dedacafcca883a3b20302762c872280.zip
fix: skip declined events in tooltip, modeline, and notifications
org-gcal writes `:STATUS: declined' on calendar entries the user has declined, and chime was happily showing them in the tooltip, modeline, and notification stream — which defeats the whole point of declining a meeting. I added `chime-declined-events-predicate', mirroring the shape of `chime-done-keywords-predicate', and put it on the default `chime-predicate-blacklist'. The match is on the literal lowercase value because that's what real org-gcal exports use; uppercase or other values pass through. Users who want declined events back can pop the predicate off the blacklist. Tests cover all four STATUS values seen in real org-gcal data (accepted, declined, needs-action, tentative), plus the no-property, empty-property, todo-keyword-still-attached, gibberish-value, case-sensitivity, and default-blacklist-membership cases.
Diffstat (limited to 'chime.el')
-rw-r--r--chime.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/chime.el b/chime.el
index f33a7c1..cd47d19 100644
--- a/chime.el
+++ b/chime.el
@@ -262,7 +262,8 @@ running the async command to check notifications."
:type '(repeat string))
(defcustom chime-predicate-blacklist
- '(chime-done-keywords-predicate)
+ '(chime-done-keywords-predicate
+ chime-declined-events-predicate)
"Never receive notifications for events matching these predicates.
Each function should take an event POM and return non-nil iff that event should
not trigger a notification."
@@ -1280,6 +1281,14 @@ Combines keyword, tag, and custom predicate blacklists."
(goto-char (marker-position marker))
(member (nth 2 (org-heading-components)) org-done-keywords))))
+(defun chime-declined-events-predicate (marker)
+ "Return non-nil when entry at MARKER carries `:STATUS: declined'.
+This is the marker org-gcal writes for events the user has declined in
+their calendar. Only the literal lowercase `declined' value is matched
+because that is what real org-gcal exports use."
+ (let ((status (org-entry-get marker "STATUS")))
+ (and status (string= status "declined"))))
+
(defun chime--apply-whitelist (markers)
"Apply whitelist to MARKERS."
(-if-let (whitelist-predicates (chime--whitelist-predicates))