diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-10-08 18:06:18 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-10-08 18:06:18 +0200 |
commit | 6d2865f5034043be7f3653f44f533ebb969e79c5 (patch) | |
tree | 6f6d7778e06e5e19a48a139ae4a05b3bf4f290ac | |
parent | 4bef5506c12495861def5507660397f49c89cb29 (diff) |
add mastodon-notifications--get-unread-count
-rw-r--r-- | lisp/mastodon-notifications.el | 7 |
1 files changed, 7 insertions, 0 deletions
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 |