aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index f0ef000..8c02adf 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2103,12 +2103,23 @@ headers."
;; for everything save profiles
(mastodon-tl--goto-first-item)))))
-(defun mastodon-tl--init-sync (buffer-name endpoint update-function)
+(defun mastodon-tl--init-sync (buffer-name endpoint update-function &optional note-type)
"Initialize BUFFER-NAME with timeline targeted by ENDPOINT.
UPDATE-FUNCTION is used to receive more toots.
Runs synchronously."
- (let* ((url (mastodon-http--api endpoint))
+ (let* ((exclude-types (when note-type
+ (mastodon-notifications--filter-types-list note-type)))
+ (args (when note-type
+ (mapcar (lambda (x)
+ `("exclude_types[]" . ,x))
+ exclude-types)))
+ (query-string (when note-type
+ (mastodon-http--build-query-string args)))
+ ;; add note-type exclusions to endpoint so it works in `mastodon-tl--buffer-spec'
+ ;; that way `mastodon-tl--more' works seamlessly too:
+ (endpoint (if note-type (concat endpoint "?" query-string) endpoint))
+ (url (mastodon-http--api endpoint))
(buffer (concat "*mastodon-" buffer-name "*"))
(json (mastodon-http--get-json url)))
(with-output-to-temp-buffer buffer