From 8729f5e4665cf95b18c167f51562c38cf15db071 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 20 Oct 2018 17:19:32 +0200 Subject: Do not move CWs to toot body when toot body is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/services/post_status_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') 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, -- cgit