aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-profile.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-08-22 18:20:30 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-08-22 18:39:46 +0200
commitef0db16833485400704c1b65d5a4e464256a94b7 (patch)
treed670f6b9ebe1a7d5df8f67176290e3b2c23e6055 /lisp/mastodon-profile.el
parent38d6382a1f8bc50c76f77a407ae5db4ff0d75156 (diff)
new fun: mastodon-return-credential-account, var: mastodon-profile-credential-account
FIX #480.
Diffstat (limited to 'lisp/mastodon-profile.el')
-rw-r--r--lisp/mastodon-profile.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index bbd286e..de235b3 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -105,6 +105,10 @@ extra keybindings."
:group 'mastodon
:global nil)
+(defvar mastodon-profile-credential-account nil
+ "Holds the JSON data of the CredentialAccount entity,
+ containing details of the current user's account.")
+
(defvar mastodon-profile-update-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-c") #'mastodon-profile--user-profile-send-updated)
@@ -212,8 +216,7 @@ NO-REBLOGS means do not display boosts in statuses."
(defun mastodon-profile--get-json-value (val)
"Fetch current VAL ue from account."
- (let* ((url (mastodon-http--api "accounts/verify_credentials"))
- (response (mastodon-http--get-json url)))
+ (let* ((response (mastodon-return-credential-account)))
(if (eq (alist-get val response) :json-false)
nil
(alist-get val response))))
@@ -232,9 +235,7 @@ NO-REBLOGS means do not display boosts in statuses."
(defun mastodon-profile--update-user-profile-note ()
"Fetch user's profile note and display for editing."
(interactive)
- (let* ((endpoint "accounts/verify_credentials")
- (url (mastodon-http--api endpoint))
- (json (mastodon-http--get-json url))
+ (let* ((json (mastodon-return-credential-account))
(source (alist-get 'source json))
(note (alist-get 'note source))
(buffer (get-buffer-create "*mastodon-update-profile*"))