From 6d2865f5034043be7f3653f44f533ebb969e79c5 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 8 Oct 2024 18:06:18 +0200 Subject: add mastodon-notifications--get-unread-count --- lisp/mastodon-notifications.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index bab2e13..ce3aea8 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -380,5 +380,12 @@ Status notifications are created when you call (mastodon-tl--reload-timeline-or-profile)) (message "Notification dismissed!"))))) +(defun mastodon-notifications--get-unread-count () + "Return the number of unread notifications for the current account." + ;; params: limit - max 1000, default 100, types[], exclude_types[], account_id + (let* ((endpoint "notifications/unread_count") + (url (mastodon-http--api endpoint))) + (mastodon-http--get-json url))) + (provide 'mastodon-notifications) ;;; mastodon-notifications.el ends here -- cgit v1.2.3