diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-04-01 17:09:24 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-04-01 17:20:11 +0200 |
commit | 08dc0d1990754a94cf2dc0899c8a579bb485c377 (patch) | |
tree | 32e558822d32f7091132fcd1401b28eae2846103 | |
parent | b028fd1cab992b90164665d5997c25782d621d93 (diff) |
timeline of all followed tags. FIX #409.
-rw-r--r-- | README.org | 1 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 22 | ||||
-rw-r--r-- | lisp/mastodon.el | 2 |
3 files changed, 21 insertions, 4 deletions
@@ -136,6 +136,7 @@ not contain =:client_id= and =:client_secret=. | =U= | update your profile bio note | | =;= | view instance description for toot at point | | =:= | view followed tags and load a tag timeline | +| =M-:= | view timeline of all followed tags | | =,= | view favouriters of toot at point | | =.= | view boosters of toot at point | | =/= | switch between mastodon buffers | diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 0c3630b..46ea5da 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -400,6 +400,7 @@ With a double PREFIX arg, limit results to your own instance." (defun mastodon-tl--show-tag-timeline (&optional prefix tag) "Opens a new buffer showing the timeline of posts with hastag TAG. +If TAG is a list, show a timeline for all tags. With a single PREFIX arg, only show posts with media. With a double PREFIX arg, limit results to your own instance." (let ((params @@ -409,13 +410,18 @@ With a double PREFIX arg, limit results to your own instance." (push '("only_media" . "true") params)) (when (eq prefix 16) (push '("local" . "true") params)) - (mastodon-tl--init (concat "tag-" tag) - (concat "timelines/tag/" tag) + (when (listp tag) + (let ((list (mastodon-http--build-array-params-alist "any[]" (cdr tag)))) + (while list + (push (pop list) params)))) + (mastodon-tl--init (concat "tag-" (if (listp tag) "followed-tags" tag)) + (concat "timelines/tag/" (if (listp tag) + ;; endpoint needs to be /tag/:sometag + (car tag) tag)) 'mastodon-tl--timeline nil params))) - ;;; BYLINES, etc. @@ -899,7 +905,7 @@ Used for hitting RET on a given link." (cond ((eq link-type 'content-warning) (mastodon-tl--toggle-spoiler-text position)) ((eq link-type 'hashtag) - (mastodon-tl--show-tag-timeline (get-text-property position 'mastodon-tag))) + (mastodon-tl--show-tag-timeline nil (get-text-property position 'mastodon-tag))) ;; 'account / 'account-id is not set for mentions, only bylines ((eq link-type 'user-handle) (let ((account-json (get-text-property position 'account)) @@ -2078,6 +2084,14 @@ If TAG is provided, unfollow it." (message "You have to follow some tags first.") (mastodon-tl--get-tag-timeline nil tag)))) +(defun mastodon-tl--followed-tags-timeline () + "Open a timeline of all your followed tags." + (interactive) + (let* ((followed-tags-json (mastodon-tl--followed-tags)) + (tags (mastodon-tl--map-alist 'name followed-tags-json))) + (mastodon-tl--show-tag-timeline nil tags))) + + ;;; UPDATING, etc. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index ef0d2c0..1b975f2 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -64,6 +64,7 @@ (autoload 'mastodon-profile--view-favourites "mastodon-profile") (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--follow-user "mastodon-tl") +(autoload 'mastodon-tl--followed-tags-timeline "mastodon-tl") (autoload 'mastodon-tl--get-buffer-type "mastodon-tl") (autoload 'mastodon-tl--get-federated-timeline "mastodon-tl") (autoload 'mastodon-tl--get-home-timeline "mastodon-tl") @@ -152,6 +153,7 @@ Use. e.g. \"%c\" for your locale's date and time format." ;; navigation between timelines (define-key map (kbd "#") #'mastodon-tl--get-tag-timeline) (define-key map (kbd ":") #'mastodon-tl--list-followed-tags) + (define-key map (kbd "M-:") #'mastodon-tl--followed-tags-timeline) (define-key map (kbd "A") #'mastodon-profile--get-toot-author) (define-key map (kbd "F") #'mastodon-tl--get-federated-timeline) (define-key map (kbd "H") #'mastodon-tl--get-home-timeline) |