Runtime configured emojis
The changes are a bit heavy since the emojis were loaded into module attributes from filesystem. This introduces a GenServer using an ETS table to cache in memory the emojis, and allows a runtime-reload with `Pleroma.Emoji.reload()`.
This commit is contained in:
parent
bd97b3614f
commit
763fc7b44f
5 changed files with 206 additions and 128 deletions
|
|
@ -6,7 +6,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
alias Pleroma.Web.WebFinger
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Comeonin.Pbkdf2
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.{Formatter, Emoji}
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.{Repo, PasswordResetToken, User}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
end
|
||||
|
||||
def emoji(conn, _params) do
|
||||
json(conn, Enum.into(Formatter.get_custom_emoji(), %{}))
|
||||
json(conn, Enum.into(Emoji.get_all(), %{}))
|
||||
end
|
||||
|
||||
def follow_import(conn, %{"list" => %Plug.Upload{} = listfile}) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue