From b9c76e2edbc372e1b472f6ba480631b79fe24722 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 5 Oct 2017 23:41:47 +0200 Subject: When processing custom emoji, ensure a non-animated version exists (#5230) Use the non-animated version in web UI, but return both in API --- app/serializers/rest/custom_emoji_serializer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/serializers/rest/custom_emoji_serializer.rb') diff --git a/app/serializers/rest/custom_emoji_serializer.rb b/app/serializers/rest/custom_emoji_serializer.rb index b744dd4ec..b958e6a5d 100644 --- a/app/serializers/rest/custom_emoji_serializer.rb +++ b/app/serializers/rest/custom_emoji_serializer.rb @@ -3,9 +3,13 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer include RoutingHelper - attributes :shortcode, :url + attributes :shortcode, :url, :static_url def url full_asset_url(object.image.url) end + + def static_url + full_asset_url(object.image.url(:static)) + end end -- cgit