logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 6936854878860d1f6d04db1cd14a00208c6a5728
parent: 09bd1d12c112fe45563c25a76afde65a3381aa26
Author: rinpatch <rinpatch@sdf.org>
Date:   Fri, 17 Apr 2020 13:40:25 +0000

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

Diffstat:

Mlib/pleroma/web/activity_pub/activity_pub.ex2+-
Mpriv/repo/migrations/20200406100225_users_add_emoji.exs2+-
2 files changed, 2 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,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) diff --git a/priv/repo/migrations/20200406100225_users_add_emoji.exs b/priv/repo/migrations/20200406100225_users_add_emoji.exs @@ -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)