aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-10-25 16:58:39 +0200
committermousebot <mousebot@riseup.net>2021-10-25 16:58:39 +0200
commit0dd83c5ada4bb4c0b73ebc43de4dcc58825b3f6f (patch)
tree27e1464ab9062000087133be85a9805d567ffb3b /lisp
parent3a892a4caa8b77c7f634f192ea22620af6506877 (diff)
revert tl--thread to sync request for speed.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el19
1 files 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."