aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-05 10:40:26 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-05 10:40:26 +0100
commit40cf1038e386cfe62cfcc81234794b3a13102176 (patch)
treefbfa46465b9adeef825f8e612fd593d316c39aee /lisp/mastodon-tl.el
parenta7fa1f599630aa0f49e8d0a91d400c6f267622f1 (diff)
add headers arg to http--process-json and --get-json-async
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 1986979..a9c8b39 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1139,7 +1139,7 @@ Then run CALLBACK with arguments CBARGS."
"?")
"max_id="
(mastodon-tl--as-string id)))))
- (apply 'mastodon-http--get-json-async url callback cbargs)))
+ (apply 'mastodon-http--get-json-async url nil callback cbargs)))
;; TODO
;; Look into the JSON returned here by Local
@@ -1907,14 +1907,15 @@ from the start if it is nil."
(goto-char (or mastodon-tl--update-point (point-min)))
(funcall update-function json)))))
-(defun mastodon-tl--init (buffer-name endpoint update-function)
+(defun mastodon-tl--init (buffer-name endpoint update-function &optional headers)
"Initialize BUFFER-NAME with timeline targeted by ENDPOINT asynchronously.
-
-UPDATE-FUNCTION is used to recieve more toots."
+UPDATE-FUNCTION is used to recieve more toots.
+HEADERS means to also collect the response headers. Used for paginating
+favourites."
(let ((url (mastodon-http--api endpoint))
(buffer (concat "*mastodon-" buffer-name "*")))
(mastodon-http--get-json-async
- url 'mastodon-tl--init* buffer endpoint update-function)))
+ url headers 'mastodon-tl--init* buffer endpoint update-function)))
(defun mastodon-tl--init* (json buffer endpoint update-function)
"Initialize BUFFER with timeline targeted by ENDPOINT.