logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

emojis_controller.rb (603B)


  1. # frozen_string_literal: true
  2. class EmojisController < ApplicationController
  3. before_action :set_emoji
  4. before_action :set_cache_headers
  5. def show
  6. respond_to do |format|
  7. format.json do
  8. skip_session!
  9. render_cached_json(['activitypub', 'emoji', @emoji.cache_key], content_type: 'application/activity+json') do
  10. ActiveModelSerializers::SerializableResource.new(@emoji, serializer: ActivityPub::EmojiSerializer, adapter: ActivityPub::Adapter)
  11. end
  12. end
  13. end
  14. end
  15. private
  16. def set_emoji
  17. @emoji = CustomEmoji.local.find(params[:id])
  18. end
  19. end