From 40cf1038e386cfe62cfcc81234794b3a13102176 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 5 Nov 2022 10:40:26 +0100 Subject: add headers arg to http--process-json and --get-json-async --- lisp/mastodon-tl.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lisp/mastodon-tl.el') 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. -- cgit v1.2.3