diff options
author | mousebot <mousebot@riseup.net> | 2021-05-08 21:20:33 +0200 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2021-05-09 11:24:31 +0200 |
commit | c69bf45a170a28934d18b762960845e773922514 (patch) | |
tree | 0cabff2b0f5ea3a650270c7a6c006351104f981b /lisp/mastodon-profile.el | |
parent | 4b4f45e4e3f09c065e547ff5def03bde7e42de2d (diff) |
async view profile, async view thread, better prompts
- view profile (using make-profile-buffer-for).
- user confirm to delete toot.
- better follow/mute/block/profile prompts
Diffstat (limited to 'lisp/mastodon-profile.el')
-rw-r--r-- | lisp/mastodon-profile.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index aed33a7..2c6b798 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -102,12 +102,17 @@ following the current profile." (defun mastodon-profile--make-profile-buffer-for (account endpoint-type update-function) (let* ((id (mastodon-profile--account-field account 'id)) - (acct (mastodon-profile--account-field account 'acct)) (url (mastodon-http--api (format "accounts/%s/%s" - id endpoint-type))) + id endpoint-type)))) + (mastodon-http--get-json-async url + 'mastodon-profile--make-profile-buffer-for* + account endpoint-type update-function))) + +(defun mastodon-profile--make-profile-buffer-for* (json account endpoint-type update-function) + (let* ((acct (mastodon-profile--account-field account 'acct)) (buffer (concat "*mastodon-" acct "-" endpoint-type "*")) (note (mastodon-profile--account-field account 'note)) - (json (mastodon-http--get-json url)) + (id (mastodon-profile--account-field account 'id)) (fol_count (mastodon-tl--as-string (mastodon-profile--account-field account 'followers_count))) (folling_count (mastodon-tl--as-string (mastodon-profile--account-field account 'following_count))) (toots_count (mastodon-tl--as-string (mastodon-profile--account-field account 'statuses_count)))) @@ -175,7 +180,7 @@ following the current profile." (list (let ((user-handles (mastodon-profile--extract-users-handles (mastodon-profile--toot-json)))) - (completing-read "User handle: " + (completing-read "View profile of user: " user-handles nil ; predicate 'confirm)))) |