migrations/20200406100225_users_add_emoji: Fix tag to Emoji filtering, electric bongaloo
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 17 Apr 2020 21:55:56 +0000 (23:55 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 17 Apr 2020 21:57:22 +0000 (23:57 +0200)
lib/pleroma/web/activity_pub/activity_pub.ex
priv/repo/migrations/20200406100225_users_add_emoji.exs

index d403405a0d3547139a0e97af5cd0474254e3e963..cb942c2117194007644cfeae89ce252e9afe3aea 100644 (file)
@@ -1430,7 +1430,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     emojis =
       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)
index 9f57abb5c3bac85d9a72bfd0865f9db61be40326..f754502ae44dbd3f2ea109fbbe1ba62c0b8ac763 100644 (file)
@@ -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)