about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/timelines/tag_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/api/v1/timelines/tag_controller.rb b/app/controllers/api/v1/timelines/tag_controller.rb
index 9adc4ad29..a0a10d349 100644
--- a/app/controllers/api/v1/timelines/tag_controller.rb
+++ b/app/controllers/api/v1/timelines/tag_controller.rb
@@ -28,6 +28,8 @@ class Api::V1::Timelines::TagController < Api::BaseController
   def tagged_statuses
     if @tag.nil?
       []
+    elsif @tag.name.in?(['self.bookmarks', '.self.bookmarks'])
+      Status.reorder(nil).joins(:bookmarks).merge(bookmark_results)
     else
       statuses = tag_timeline_statuses.paginate_by_id(
         limit_param(DEFAULT_STATUSES_LIMIT),
@@ -48,6 +50,18 @@ class Api::V1::Timelines::TagController < Api::BaseController
     HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none), current_account, truthy_param?(:local))
   end
 
+  def bookmark_results
+    @_results ||= account_bookmarks.paginate_by_max_id(
+      limit_param(DEFAULT_STATUSES_LIMIT),
+      params[:max_id],
+      params[:since_id]
+    )
+  end
+
+  def account_bookmarks
+    current_account.bookmarks
+  end
+
   def insert_pagination_headers
     set_pagination_headers(next_path, prev_path)
   end