From 4739e0f090a04235669ef81fa432ae90bb62f4c4 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 20 Oct 2018 19:14:46 +0200 Subject: [PATCH] =?UTF-8?q?Put=20a=20video=20camera=20emoji=20or=20a=20pic?= =?UTF-8?q?ture=20frame=20emoji=20instead=20of=20=E2=80=9C.=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This uses the same logic as the status icons in the glitch flavor. --- app/services/post_status_service.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index ebb620ed9..d7d7770e9 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -21,7 +21,10 @@ class PostStatusService < BaseService media = validate_media!(options[:media_ids]) status = nil - text = '.' if text.blank? && options[:spoiler_text].present? + if text.blank? && options[:spoiler_text].present? + text = '.' + text = media.find(&:video?) ? '📹' : '🖼' if media.size > 0 + end ApplicationRecord.transaction do status = account.statuses.create!(text: text,