emojis_controller.rb 456 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. class EmojisController < ApplicationController
  3. before_action :set_emoji
  4. vary_by -> { 'Signature' if authorized_fetch_mode? }
  5. def show
  6. expires_in 3.minutes, public: true
  7. render_with_cache json: @emoji, content_type: 'application/activity+json', serializer: ActivityPub::EmojiSerializer, adapter: ActivityPub::Adapter
  8. end
  9. private
  10. def set_emoji
  11. @emoji = CustomEmoji.local.find(params[:id])
  12. end
  13. end