From f10b33b7a6a9975a4627a4e4e9adc118c0a49a92 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 15:31:55 +0100 Subject: factor out a decent insert-follow-requests fun --- lisp/mastodon-profile.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 8ac0b67..f779648 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -161,7 +161,21 @@ extra keybindings." (interactive) (mastodon-tl--init "follow-requests" "follow_requests" - 'mastodon-profile--add-author-bylines)) + 'mastodon-profile--insert-follow-requests)) + +(defun mastodon-profile--insert-follow-requests (json) + "Insert the user's current follow requests. +JSON is the data returned by the server." + (insert (mastodon-tl--set-face + (concat "\n ------------\n" + " FOLLOW REQUESTS\n" + " ------------\n\n") + 'success)) + (if (equal json '[]) + (insert (propertize + "Looks like you have no follow requests for now." + 'face font-lock-comment-face)) + (mastodon-profile--add-author-bylines json))) (defun mastodon-profile--update-user-profile-note () "Fetch user's profile note and display for editing." -- cgit v1.2.3