summaryrefslogtreecommitdiff
path: root/priv/repo/migrations
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-04-17 23:55:56 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-04-17 23:57:22 +0200
commiteb61564005b743acefe7bb31c9369c38c9dfad6e (patch)
treed8780b2967ce2be371891ba8f586b9b91135bbcb /priv/repo/migrations
parent46f051048fb1afb02fe81b872ae9f595f2c5f2c1 (diff)
downloadpleroma-eb61564005b743acefe7bb31c9369c38c9dfad6e.tar.gz
pleroma-eb61564005b743acefe7bb31c9369c38c9dfad6e.zip
migrations/20200406100225_users_add_emoji: Fix tag to Emoji filtering, electric bongaloo
Diffstat (limited to 'priv/repo/migrations')
-rw-r--r--priv/repo/migrations/20200406100225_users_add_emoji.exs5
1 files changed, 4 insertions, 1 deletions
diff --git a/priv/repo/migrations/20200406100225_users_add_emoji.exs b/priv/repo/migrations/20200406100225_users_add_emoji.exs
index 9f57abb5c..f754502ae 100644
--- a/priv/repo/migrations/20200406100225_users_add_emoji.exs
+++ b/priv/repo/migrations/20200406100225_users_add_emoji.exs
@@ -17,7 +17,10 @@ defmodule Pleroma.Repo.Migrations.UsersPopulateEmoji do
emoji =
user.source_data
|> Map.get("tag", [])
- |> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
+ |> Enum.filter(fn
+ %{"type" => t} -> t == "Emoji"
+ _ -> false
+ end)
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
Map.put(acc, String.trim(name, ":"), url)
end)