about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-03-27 21:54:44 +0100
committerThibaut Girka <thib@sitedethib.com>2020-03-27 21:54:44 +0100
commit7b435fd9bf81265241fab792d8e8e0c2f4f1b619 (patch)
treeef366f436ed5180489cc9377268e10328fe9a932 /app/services
parent02f1c04fabab221130de8dfb5611be81825b193b (diff)
parent6c79b7237e31eb510af7df3f4f2cb133dea39845 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/services/post_status_service.rb`:
  CW/sensitive logic fixed upstream, but different in glitch-soc.
  Ported the changes accordingly.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 5b181b193..39b834604 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -58,6 +58,7 @@ class PostStatusService < BaseService
        @text = '🖼'
      end
     end
+    @sensitive    = (@options[:sensitive].nil? ? @account.user&.setting_default_sensitive : @options[:sensitive]) || @options[:spoiler_text].present?
     @visibility   = @options[:visibility] || @account.user&.setting_default_privacy
     @visibility   = :unlisted if @visibility&.to_sym == :public && @account.silenced?
     @scheduled_at = @options[:scheduled_at]&.to_datetime
@@ -166,7 +167,7 @@ class PostStatusService < BaseService
       media_attachments: @media || [],
       thread: @in_reply_to,
       poll_attributes: poll_attributes,
-      sensitive: (@options[:sensitive].nil? ? @account.user&.setting_default_sensitive : @options[:sensitive]) || @options[:spoiler_text].present?,
+      sensitive: @sensitive,
       spoiler_text: @options[:spoiler_text] || '',
       visibility: @visibility,
       language: language_from_option(@options[:language]) || @account.user&.setting_default_language&.presence || LanguageDetector.instance.detect(@text, @account),