mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-18 07:48:19 +00:00
Merge branch 'bugfix/1695-user_emoji_miration' into 'develop'
migrations/20200406100225_users_add_emoji: Fix tag to Emoji filtering Closes #1695 See merge request pleroma/pleroma!2398
This commit is contained in:
commit
6936854878
|
@ -1430,7 +1430,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
emojis =
|
||||
data
|
||||
|> Map.get("tag", [])
|
||||
|> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
|
||||
|> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
|
||||
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
|
||||
Map.put(acc, String.trim(name, ":"), url)
|
||||
end)
|
||||
|
|
|
@ -17,7 +17,7 @@ defmodule Pleroma.Repo.Migrations.UsersPopulateEmoji do
|
|||
emoji =
|
||||
user.source_data
|
||||
|> Map.get("tag", [])
|
||||
|> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
|
||||
|> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
|
||||
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
|
||||
Map.put(acc, String.trim(name, ":"), url)
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue