aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@disroot.org>2024-10-26 10:25:53 +0200
committermarty hiatt <martianhiatus@disroot.org>2024-10-26 10:25:53 +0200
commite8aa0fafb40bbac3a7e5a701e721d9c61cb863d5 (patch)
tree9874f27395f5db0879d9a939ab8a25212f2cfb44 /lisp/mastodon.el
parent3a20ca8eef71966ef7d4ecde4ffedef49e25343a (diff)
parent8c77159f4f33d37e5c443d780a5cd88ccb545235 (diff)
Merge branch 'poll-transient' into develop
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r--lisp/mastodon.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 89e2a87..8560902 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -337,6 +337,15 @@ FORCE means to fetch from the server in any case and update
;; else just return the var:
mastodon-profile-credential-account))
+(defvar mastodon-instance-data nil
+ "Instance data from the instance endpoint.")
+
+(defun mastodon-instance-data ()
+ "Return `mastodon-instnace-data' or else fetch from instance endpoint."
+ (or mastodon-instance-data
+ (setq mastodon-instance-data
+ (mastodon-http--get-json (mastodon-http--api "instance")))))
+
;;;###autoload
(defun mastodon-toot (&optional user reply-to-id reply-json)
"Update instance with new toot. Content is captured in a new buffer.