diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-12-06 12:26:49 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-12-06 12:28:50 -0600 |
commit | 0ae1bc9796c9d337a9e5d90d4877302e20e7c8fa (patch) | |
tree | 22428c8a939bec0c8c188f04efa88bd998598e39 /app/services | |
parent | ac5fb845afd01de0bfe9c1bfe8245af8dedac9bb (diff) |
make posts with `#``self.draft` scope private by default
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/post_status_service.rb | 8 |
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 |