diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-08-30 09:45:17 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-08-30 09:45:17 +0200 |
commit | 8f4b5f5ad8c6dcb867d864ea179934136dfe2640 (patch) | |
tree | 5eb8798d78852258c26c1501827732eea3cc8fdd /lisp/mastodon.el | |
parent | 1b9686bb2b8b16ae36278f6f162c80d01ab57138 (diff) |
refactor mastodon-return-credential-account
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r-- | lisp/mastodon.el | 17 |
1 files changed, 8 insertions, 9 deletions
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) |