logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 79445ae5d25d7d0f775107eeede167dfd9aeb1bf
parent: f1843db41d27c695b4fdb92b13fe6642102a35bc
Author: Haelwenn <contact+git.pleroma.social@hacktivis.me>
Date:   Sat, 18 Apr 2020 06:59:23 +0000

Merge branch 'bugfix/1697-user_emoji_miration' into 'develop'

migrations/20200406100225_users_add_emoji: Fix tag to Emoji filtering, electric bongaloo

Closes #1697

See merge request pleroma/pleroma!2403

Diffstat:

Mlib/pleroma/web/activity_pub/activity_pub.ex5++++-
Mpriv/repo/migrations/20200406100225_users_add_emoji.exs5++++-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -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" => "Emoji"} -> true + _ -> false + end) |> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc -> Map.put(acc, String.trim(name, ":"), url) end) diff --git 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" => "Emoji"} -> true + _ -> false + end) |> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc -> Map.put(acc, String.trim(name, ":"), url) end)