about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-10-20 17:19:32 +0200
committerThibG <thib@sitedethib.com>2018-10-21 16:09:18 +0200
commit8729f5e4665cf95b18c167f51562c38cf15db071 (patch)
treed04388873b7208bcc44c4cef9a109c0cff2136db /app
parent04bedd237bf2ec1cd5538ee2da4c60c932a66ae0 (diff)
Do not move CWs to toot body when toot body is empty
Fixes #395

Instead of leaving the toot body blank, it replaces it with a single “.” in
order for the fold/unfold CW behavior to not look *too* weird on upstream
Mastodon. Note that this does not fix upstream's CW-dropping behavior, as
that is decided at the time the toot is posted, not received.
Diffstat (limited to 'app')
-rw-r--r--app/services/post_status_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 52d49a69e..ebb620ed9 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -21,7 +21,7 @@ class PostStatusService < BaseService
 
     media  = validate_media!(options[:media_ids])
     status = nil
-    text   = options.delete(:spoiler_text) if text.blank? && options[:spoiler_text].present?
+    text   = '.' if text.blank? && options[:spoiler_text].present?
 
     ApplicationRecord.transaction do
       status = account.statuses.create!(text: text,