From 0dd83c5ada4bb4c0b73ebc43de4dcc58825b3f6f Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 25 Oct 2021 16:58:39 +0200 Subject: revert tl--thread to sync request for speed. --- lisp/mastodon-tl.el | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index b4e3ae2..4d30f51 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -915,23 +915,16 @@ webapp" (reblog (cdr (assoc 'reblog json)))) (if reblog (cdr (assoc 'id reblog)) id))) + (defun mastodon-tl--thread () - "Open thread buffer for toot under `point' asynchronously." + "Open thread buffer for toot under `point'." (interactive) (let* ((id (mastodon-tl--as-string (mastodon-tl--toot-id (mastodon-tl--property 'toot-json)))) - (toot (mastodon-tl--property 'toot-json)) + (url (mastodon-http--api (format "statuses/%s/context" id))) (buffer (format "*mastodon-thread-%s*" id)) - (url (mastodon-http--api (format "statuses/%s/context" id)))) - (mastodon-http--get-json-async url - 'mastodon-tl--thread* id toot buffer))) - -(defun mastodon-tl--thread* (context id toot buffer) - "Callback for async `mastodon-tl--thread'. - -Open thread buffer for TOOT with id ID under `point'asynchronously, -in new BUFFER. -CONTEXT is the previous and subsequent toots in the thread." + (toot (mastodon-tl--property 'toot-json)) + (context (mastodon-http--get-json url))) (when (member (cdr (assoc 'type toot)) '("reblog" "favourite")) (setq toot (cdr (assoc 'status toot)))) (if (> (+ (length (cdr (assoc 'ancestors context))) @@ -950,7 +943,7 @@ CONTEXT is the previous and subsequent toots in the thread." (cdr (assoc 'ancestors context)) `(,toot) (cdr (assoc 'descendants context)))))) - (message "No Thread!")));) + (message "No Thread!")))) (defun mastodon-tl--follow-user (user-handle) "Query for USER-HANDLE from current status and follow that user." -- cgit v1.2.3