1
0
mirror of https://git.pleroma.social/sjw/pleroma.git synced 2024-12-25 06:35:12 +01:00

migrations/20200406100225_users_add_emoji: Fix tag to Emoji filtering

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-04-17 14:32:15 +02:00
parent d8142ee6fe
commit 46f051048f
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)