aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2022-02-15 15:31:55 +0100
committermousebot <mousebot@riseup.net>2022-02-15 15:33:33 +0100
commitf10b33b7a6a9975a4627a4e4e9adc118c0a49a92 (patch)
treed0ebe4ecd53e5ebafdb84b343c8b1641957fd1e5
parent787f18dcff2ee7a4c5a5cbf331f4e2d26997e1cc (diff)
factor out a decent insert-follow-requests fun
-rw-r--r--lisp/mastodon-profile.el16
1 files changed, 15 insertions, 1 deletions
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."