aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-01-09 20:51:36 +1100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-01-09 20:51:36 +1100
commiteb8141cff000ce74a6aeb096a20cbaa9b92b8662 (patch)
tree6f435c226eb866e85b46a7eb8f10dd873ec26e81 /lisp/mastodon-tl.el
parent7354b5abfa9a29169a299e9204c9154ddbce8b76 (diff)
factor out mastodon-tl--update-params.
we use this so that things don't break when (mastodon-tl--get-buffer-property 'update-params) is called when update-params is not set, which causes an error. we might also just remove the error call in that function and return nil if a buffer prop is not set.
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index dbeacab..72cc4a1 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1390,6 +1390,11 @@ Optionally get it for BUFFER."
Optionally get it for BUFFER."
(mastodon-tl--get-buffer-property 'link-header buffer))
+(defun mastodon-tl--update-params (&optional buffer)
+ "Get the UPDATE PARAMS stored in `mastodon-tl--buffer-spec'.
+Optionally get it for BUFFER."
+ (mastodon-tl--get-buffer-property 'update-params buffer))
+
(defun mastodon-tl--get-buffer-property (property &optional buffer)
"Get PROPERTY from `mastodon-tl--buffer-spec' in BUFFER or `current-buffer'."
(with-current-buffer (or buffer (current-buffer))
@@ -2607,7 +2612,7 @@ when showing followers or accounts followed."
(mastodon-tl--more-json-async
(mastodon-tl--get-endpoint)
(mastodon-tl--oldest-id)
- (mastodon-tl--get-buffer-property 'update-params)
+ (mastodon-tl--update-params)
'mastodon-tl--more* (current-buffer) (point))))
(defun mastodon-tl--more* (response buffer point-before &optional headers)
@@ -2812,7 +2817,7 @@ This location is defined by a non-nil value of
(funcall update-function thread-id)
;; update other timelines:
(let* ((id (mastodon-tl--newest-id))
- (params (mastodon-tl--get-buffer-property 'update-params))
+ (params (mastodon-tl--update-params))
(json (mastodon-tl--updated-json endpoint id params)))
(if json
(let ((inhibit-read-only t))