From ff7b888c0560eec141213e7ee37ff1ca30942ae8 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sun, 16 Feb 2020 01:09:55 -0600 Subject: accept `hidden` parameter & mark manually-tagged drafts as hidden --- app/services/post_status_service.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 7c36a5941..415243485 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -24,6 +24,7 @@ class PostStatusService < BaseService # @option [Time] :created_at Optional time which status was originally posted # @option [Boolean] :sensitive # @option [String] :visibility + # @option [Boolean] :hidden # @option [Boolean] :local_only # @option [String] :sharekey # @option [String] :spoiler_text @@ -50,6 +51,7 @@ class PostStatusService < BaseService @tags = @options[:tags] || [] @local_only = @options[:local_only] @sensitive = (@account.force_sensitive? ? true : @options[:sensitive]) + @hidden = @options[:hidden] || false @preloaded_tags = @options[:preloaded_tags] || [] @preloaded_mentions = @options[:preloaded_mentions] || [] @@ -78,7 +80,7 @@ class PostStatusService < BaseService distribute: @options[:distribute], nocrawl: @options[:nocrawl], reject_replies: @options[:noreplies] || false, - hidden: false, + hidden: @hidden, }.compact PostStatusWorker.perform_at(@delay_until, @status.id, opts) @@ -128,8 +130,8 @@ class PostStatusService < BaseService def limit_visibility_if_draft if @tags.include?('self.draft') || @preloaded_tags.include?('self.draft') - @visibility = :direct @local_only = true + @hidden = true end end -- cgit