about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/services/post_status_service.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 6b3d10584..04be5e4db 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -114,6 +114,13 @@ class PostStatusService < BaseService
       VISIBILITY_RANK[@visibility] < VISIBILITY_RANK[@in_reply_to.visibility]
   end
 
+  def limit_visibility_if_draft
+    if @tags.include?('self.draft') || @preloaded_tags.include?('self.draft')
+      @visibility = :direct
+      @local_only = true
+    end
+  end
+
   def unfilter_thread_on_reply
     Redis.current.srem("filtered_threads:#{@account.id}", @in_reply_to.conversation_id)
   end
@@ -157,6 +164,7 @@ class PostStatusService < BaseService
     set_local_only
     set_initial_visibility
     limit_visibility_if_silenced
+    limit_visibility_if_draft
 
     unless @in_reply_to.nil?
       mark_recipient_known