aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-views.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-04 09:53:43 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-04 09:53:43 +0200
commit9d4cf2252d64ccd7de0e395fbcb112bd266b3057 (patch)
tree980bdb3ff4caeaac476ca0375f11605e05e5fe00 /lisp/mastodon-views.el
parentda0e348bc7aaa48474da8cf0ee657fed3f5e485d (diff)
parentb3a4709d5316d2c7322c49671a9f266db1708614 (diff)
Merge branch 'audit' into develop
Diffstat (limited to 'lisp/mastodon-views.el')
-rw-r--r--lisp/mastodon-views.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el
index 775b96b..e956ccd 100644
--- a/lisp/mastodon-views.el
+++ b/lisp/mastodon-views.el
@@ -738,6 +738,11 @@ If INSTANCE is given, use that."
(string-remove-suffix (concat "/@" username)
url))))
+(defun mastodon-views--get-own-instance ()
+ "Return JSON of `mastodon-active-user's instance."
+ (mastodon-http--get-json
+ (mastodon-http--api "instance" "v2") nil nil :vector))
+
(defun mastodon-views--view-instance-description
(&optional user brief instance misskey)
"View the details of the instance the current post's author is on.
@@ -747,8 +752,7 @@ INSTANCE is an instance domain name.
MISSKEY means the instance is a Misskey or derived server."
(interactive)
(if user
- (let ((response (mastodon-http--get-json
- (mastodon-http--api "instance" "v2") nil nil :vector)))
+ (let ((response (mastodon-views--get-own-instance)))
(mastodon-views--instance-response-fun response brief instance))
(mastodon-tl--do-if-item
(let* ((toot (if (mastodon-tl--profile-buffer-p)