From 53bf30caab7e6076ecc8307098d6b331c8258ca5 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 23 Oct 2024 21:07:43 +0200 Subject: add mastodon-instance-data var and fun mainly used in mastodon-transient.el to avoid pinging the server for instance data non-stop --- lisp/mastodon.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp/mastodon.el') 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. -- cgit v1.2.3 From 7d23c74ed57a56a1a0b640c4cf443c269486ab09 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 29 Oct 2024 10:17:38 +0100 Subject: bump version --- lisp/mastodon.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 8560902..deee0c1 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -6,7 +6,7 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; 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 -- cgit v1.2.3