diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-13 15:51:09 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-13 15:51:09 +0100 |
commit | 791cfb336891e9310dba010cee8afe8a728eda28 (patch) | |
tree | 871c96438dbea02bdea4d98754a44c5e833bac62 /lisp/mastodon-notifications.el | |
parent | 93944c51aa4612987b85aec28e8707d598bc9c7c (diff) |
notifs - rename clear-all / clear-current, y-or-n-p
Diffstat (limited to 'lisp/mastodon-notifications.el')
-rw-r--r-- | lisp/mastodon-notifications.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 510ef8c..1ecdbfb 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -267,19 +267,20 @@ of the toot responded to." "notifications" 'mastodon-notifications--timeline)) -(defun mastodon-notifications-clear () +(defun mastodon-notifications--clear-all () "Clear all notifications." (interactive) - (let ((response - (mastodon-http--post (mastodon-http--api "notifications/clear") - nil nil))) - (mastodon-http--triage - response (lambda () - (when mastodon-tl--buffer-spec - (mastodon-tl--reload-timeline-or-profile)) - (message "All notifications cleared!"))))) - -(defun mastodon-notifications-clear-current-notif () + (when (y-or-n-p "Clear all notifications?") + (let ((response + (mastodon-http--post (mastodon-http--api "notifications/clear") + nil nil))) + (mastodon-http--triage + response (lambda () + (when mastodon-tl--buffer-spec + (mastodon-tl--reload-timeline-or-profile)) + (message "All notifications cleared!")))))) + +(defun mastodon-notifications--clear-current () "Dismiss the notification at point." (interactive) (let* ((id (or (mastodon-tl--property 'toot-id) |