aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r--lisp/mastodon.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 84d3d1d..a3b372d 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -281,6 +281,7 @@ See `mastodon-toot-display-orig-in-reply-buffer'.")
(string-prefix-p "*mastodon-" (buffer-name x))
(get-buffer x)))
(buffer-list))))) ; catch any other masto buffer
+ (mastodon-return-credential-account)
(if buffer
(switch-to-buffer buffer)
(mastodon-tl--get-home-timeline)
@@ -288,6 +289,17 @@ See `mastodon-toot-display-orig-in-reply-buffer'.")
(mastodon-auth--user-acct)
mastodon-instance-url))))
+(defvar mastodon-profile-credential-account nil)
+
+(defun mastodon-return-credential-account ()
+ "Return the CredentialAccount entity.
+Either from `mastodon-profile-credential-account' or from the server."
+ (or mastodon-profile-credential-account
+ (setq mastodon-profile-credential-account
+ (mastodon-http--get-json
+ (mastodon-http--api "accounts/verify_credentials")
+ nil :silent))))
+
;;;###autoload
(defun mastodon-toot (&optional user reply-to-id reply-json)
"Update instance with new toot. Content is captured in a new buffer.