1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.CustomEmojiView do
11 def render("index.json", %{custom_emojis: custom_emojis}) do
12 render_many(custom_emojis, __MODULE__, "show.json")
15 def render("show.json", %{custom_emoji: {shortcode, %Emoji{file: relative_url, tags: tags}}}) do
16 url = Web.base_url() |> URI.merge(relative_url) |> to_string()
19 "shortcode" => shortcode,
21 "visible_in_picker" => true,
24 # Assuming that a comma is authorized in the category name
25 "category" => tags |> List.delete("Custom") |> Enum.join(",")