mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-26 02:40:18 +00:00
20 lines
572 B
Elixir
20 lines
572 B
Elixir
# Pleroma: A lightweight social networking server
|
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
defmodule Pleroma.Web.StaticFE.StaticFEView do
|
|
use Pleroma.Web, :view
|
|
|
|
alias Pleroma.User
|
|
alias Pleroma.Web.MediaProxy
|
|
alias Pleroma.Formatter
|
|
|
|
def emoji_for_user(%User{} = user) do
|
|
(user.info.source_data["tag"] || [])
|
|
|> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
|
|
|> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
|
|
{String.trim(name, ":"), url}
|
|
end)
|
|
end
|
|
end
|