aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el22
-rw-r--r--lisp/mastodon.el2
2 files changed, 20 insertions, 4 deletions
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)