From 3ba6667654ef862f66a4a173b9a61d1751b03573 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Thu, 28 Jul 2022 12:46:54 +0100 Subject: [PATCH] adapt emoji qualification for customs --- lib/pleroma/emoji.ex | 2 +- test/pleroma/emoji_test.exs | 4 ++-- .../activity_pub/transmogrifier/emoji_react_handling_test.exs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/emoji.ex b/lib/pleroma/emoji.ex index 88d81cbeb..24eafda41 100644 --- a/lib/pleroma/emoji.ex +++ b/lib/pleroma/emoji.ex @@ -125,7 +125,7 @@ defmodule Pleroma.Emoji do |> String.split("\n") |> Enum.filter(fn line -> line != "" and not String.starts_with?(line, "#") and - String.contains?(line, "qualified") + String.contains?(line, "fully-qualified") end) |> Enum.map(fn line -> line diff --git a/test/pleroma/emoji_test.exs b/test/pleroma/emoji_test.exs index 978473b14..deaab1e8b 100644 --- a/test/pleroma/emoji_test.exs +++ b/test/pleroma/emoji_test.exs @@ -13,8 +13,8 @@ defmodule Pleroma.EmojiTest do # Accept fully-qualified and unqualified emoji # See http://www.unicode.org/reports/tr51/ - assert Emoji.is_unicode_emoji?("❤") - assert Emoji.is_unicode_emoji?("☂") + refute Emoji.is_unicode_emoji?("❤") + refute Emoji.is_unicode_emoji?("☂") assert Emoji.is_unicode_emoji?("🥺") assert Emoji.is_unicode_emoji?("🤰") diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index cd26fc1a0..d6f9b0144 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -114,7 +114,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do object = Object.get_by_ap_id(data["object"]) assert object.data["reaction_count"] == 1 - assert match?([[emoji, _]], object.data["reactions"]) + assert match?([[^emoji, _, _]], object.data["reactions"]) end test "it reject invalid emoji reactions" do