about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-16 01:09:55 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-16 01:09:55 -0600
commitff7b888c0560eec141213e7ee37ff1ca30942ae8 (patch)
tree83bdcf2df27990be7cf59e7e497e9f4239858852 /app/services
parent0f9eba95d1559c8061fb7c1e7c5f484737293d18 (diff)
accept `hidden` parameter & mark manually-tagged drafts as hidden
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb6
1 files 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