static fe: add remote follow button
[akkoma] / lib / pleroma / web / static_fe / static_fe_view.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.StaticFE.StaticFEView do
6 use Pleroma.Web, :view
7
8 alias Pleroma.User
9 alias Pleroma.Web.MediaProxy
10 alias Pleroma.Formatter
11 alias Pleroma.Web.Router.Helpers
12
13 import Phoenix.HTML
14
15 def emoji_for_user(%User{} = user) do
16 (user.info.source_data["tag"] || [])
17 |> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
18 |> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
19 {String.trim(name, ":"), url}
20 end)
21 end
22 end