branch: elpa/mastodon commit be10829d43d1e93096d9d4aa5f7542dea914f22f Author: marty hiatt <martianhia...@disroot.org> Commit: marty hiatt <martianhia...@disroot.org>
transient: try to display not request counts. WIP --- lisp/mastodon-transient.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 536c0362e0..1d1ecd0ba6 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -358,11 +358,25 @@ Do not add more than the server's maximum setting." :alist-key for_private_mentions :class mastodon-transient-policy) ("l" "for limited accounts" "for_limited_accounts" :alist-key for_limited_accounts :class mastodon-transient-policy)] + ["Notification requests" + (:info #'mastodon-notifications-requests-count) + ;; (:info #'mastodon-notifications-count) + ] ["Update" ("C-c C-c" "Save settings" ;; mastodon-transient--prefix-inspect) mastodon-notifications-policy-update) ("C-x C-k" :info "Revert all changes")]) +(defun mastodon-notifications-requests-count () + "" + ;; FIXME: val doesn't contain summary, though `tp-return-data' returns it + (let ((val (transient-args 'mastodon-notifications-policy))) + (format "Pending requests: %d" + (or (map-nested-elt + val + '(summary pending_requests_count)) + 0)))) + (transient-define-suffix mastodon-notifications-policy-update (args) "Update" :transient 'transient--do-exit