From 8f4b5f5ad8c6dcb867d864ea179934136dfe2640 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 30 Aug 2023 09:45:17 +0200 Subject: refactor mastodon-return-credential-account --- lisp/mastodon.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index bc06570..1533af0 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -296,16 +296,15 @@ Either from `mastodon-profile-credential-account' or from the server. FORCE means to fetch from the server and update `mastodon-profile-credential-account'." - (if force - (setq mastodon-profile-credential-account - (mastodon-http--get-json - (mastodon-http--api "accounts/verify_credentials") - nil :silent)) - (or mastodon-profile-credential-account - (setq mastodon-profile-credential-account - (mastodon-http--get-json + (let ((req '(mastodon-http--get-json (mastodon-http--api "accounts/verify_credentials") - nil :silent))))) + nil :silent))) + (if force + (setq mastodon-profile-credential-account + (eval req)) + (or mastodon-profile-credential-account + (setq mastodon-profile-credential-account + (eval req)))))) ;;;###autoload (defun mastodon-toot (&optional user reply-to-id reply-json) -- cgit v1.2.3