diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-08-31 13:09:21 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-08-31 18:23:24 +0200 |
commit | 3619e904da5b22017776abc2f1452f1535205d11 (patch) | |
tree | 048a2d4600c4f6e14405bd4c53822a2a0145b288 | |
parent | e519b47da6023eceefd9c8bb54b2d3001fabb675 (diff) |
Fix auto-added media icons when a CW is set but no content text
-rw-r--r-- | app/services/post_status_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index b36471339..5d17f111b 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -49,7 +49,13 @@ class PostStatusService < BaseService def preprocess_attributes! if @text.blank? && @options[:spoiler_text].present? @text = '.' - @text = @media.find(&:video?) ? '📹' : '🖼' if @media.size > 0 + if @media.find(&:video?) || @media.find(&:gifv?) + @text = '📹' + elsif @media.find(&:audio?) + @text = '🎵' + elsif @media.find(&:image?) + @text = '🖼' + end end @visibility = @options[:visibility] || @account.user&.setting_default_privacy @visibility = :unlisted if @visibility == :public && @account.silenced? |