From b6184b5cc445a496397d1b90aac7634c775ca9ee Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 31 Jul 2022 22:54:30 +0200 Subject: bump version in boilerplate --- lisp/mastodon-notifications.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon-notifications.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 5de7354..4324e1b 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el -- cgit v1.2.3 From efe31d5230a0c310bdc1e2d53ca30c8123aaede2 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 30 Aug 2022 23:24:22 +0200 Subject: clear notification(s) functions --- lisp/mastodon-notifications.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lisp/mastodon-notifications.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 0d11fb4..9986ede 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -268,5 +268,33 @@ of the toot responded to." "notifications" 'mastodon-notifications--timeline)) +(defun mastodon-notifications-clear () + "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 () + "Dismiss the notification at point." + (interactive) + (let* ((id (or (mastodon-tl--property 'toot-id) + (mastodon-tl--field 'id + (mastodon-tl--property 'toot-json)))) + (response + (mastodon-http--post (mastodon-http--api + (format "notifications/%s/dismiss" id)) + nil nil))) + (mastodon-http--triage + response (lambda () + (when mastodon-tl--buffer-spec + (mastodon-tl--reload-timeline-or-profile)) + (message "Notification dismissed!"))))) + (provide 'mastodon-notifications) ;;; mastodon-notifications.el ends here -- cgit v1.2.3