diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-05-26 16:12:08 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-05-26 16:12:08 +0200 |
commit | e2071dc3d2bd5540c25f531988a8dd7e714f63cb (patch) | |
tree | f0c7a3cb2728c5f0ec4bcf2db9206ec8db324377 | |
parent | 169e751e3cf6a23bc5f9cef2a23080cd549c3f05 (diff) |
view instance desc: use api v2
-rw-r--r-- | lisp/mastodon-http.el | 7 | ||||
-rw-r--r-- | lisp/mastodon-views.el | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 49c94a4..7ef6f77 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -47,10 +47,11 @@ (defconst mastodon-http--timeout 15 "HTTP request timeout, in seconds. Has no effect on Emacs < 26.1.") -(defun mastodon-http--api (endpoint) - "Return Mastodon API URL for ENDPOINT." +(defun mastodon-http--api (endpoint &optional version) + "Return Mastodon API URL for ENDPOINT. +Optionally specify VERSION in format vX." (concat mastodon-instance-url "/api/" - mastodon-http--api-version "/" endpoint)) + (or version mastodon-http--api-version) "/" endpoint)) (defun mastodon-http--api-search () "Return Mastodon API url for the /search endpoint (v2)." diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index e9e89c0..775b96b 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -748,7 +748,7 @@ MISSKEY means the instance is a Misskey or derived server." (interactive) (if user (let ((response (mastodon-http--get-json - (mastodon-http--api "instance") nil nil :vector))) + (mastodon-http--api "instance" "v2") nil nil :vector))) (mastodon-views--instance-response-fun response brief instance)) (mastodon-tl--do-if-item (let* ((toot (if (mastodon-tl--profile-buffer-p) |