aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@disroot.org>2024-10-29 10:17:57 +0100
committermarty hiatt <martianhiatus@disroot.org>2024-10-29 10:17:57 +0100
commitbc11edccc2c292972e2e0c08bc81a9e29c2cf048 (patch)
tree3dfd1b191998b7369e8812c449b87a637726d43d /lisp/mastodon.el
parent31df8d9a0ae57342961ff46fe032c6871d2cefbb (diff)
parent7d23c74ed57a56a1a0b640c4cf443c269486ab09 (diff)
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r--lisp/mastodon.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 89e2a87..deee0c1 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -6,7 +6,7 @@
;; Author: Johnson Denen <johnson.denen@gmail.com>
;; Marty Hiatt <mousebot@disroot.org>
;; Maintainer: Marty Hiatt <mousebot@disroot.org>
-;; Version: 1.1.1
+;; Version: 1.1.2
;; Package-Requires: ((emacs "28.1") (request "0.3.0") (persist "0.4") (tp "0.1"))
;; Homepage: https://codeberg.org/martianh/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.