From 1cd9fea3b5a8b87df7fc2c102c102bca7519151a Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 5 Aug 2019 01:53:59 -0500 Subject: add ability to access bookmarks from #self.bookmarks tag --- app/controllers/api/v1/timelines/tag_controller.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app') 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 -- cgit