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.
This commit is contained in:
Thibaut Girka 2018-10-20 17:19:32 +02:00 committed by ThibG
parent 3d8c1f6104
commit 88cd14802d

View file

@ -21,7 +21,7 @@ class PostStatusService < BaseService
media = validate_media!(options[:media_ids]) media = validate_media!(options[:media_ids])
status = nil 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 ApplicationRecord.transaction do
status = account.statuses.create!(text: text, status = account.statuses.create!(text: text,