X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Femoji.ex;h=f077fe5b44ec4567cbb9014d8eb788c1c9d5f6b0;hb=1b79dce7bc53f0aa6ce07fdc178bb72b5caabe98;hp=98644f84e5f195cab27e4175af0c7cc7fac96426;hpb=1adee0832148265828b38d9b68a72dec1098bcaf;p=akkoma
diff --git a/lib/pleroma/emoji.ex b/lib/pleroma/emoji.ex
index 98644f84e..f077fe5b4 100644
--- a/lib/pleroma/emoji.ex
+++ b/lib/pleroma/emoji.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emoji do
@@ -104,11 +104,19 @@ defmodule Pleroma.Emoji do
@external_resource "lib/pleroma/emoji-test.txt"
+ regional_indicators =
+ Enum.map(127_462..127_487, fn codepoint ->
+ <>
+ end)
+
emojis =
@external_resource
|> File.read!()
|> String.split("\n")
- |> Enum.filter(fn line -> line != "" and not String.starts_with?(line, "#") end)
+ |> Enum.filter(fn line ->
+ line != "" and not String.starts_with?(line, "#") and
+ String.contains?(line, "fully-qualified")
+ end)
|> Enum.map(fn line ->
line
|> String.split(";", parts: 2)
@@ -122,6 +130,8 @@ defmodule Pleroma.Emoji do
end)
|> Enum.uniq()
+ emojis = emojis ++ regional_indicators
+
for emoji <- emojis do
def is_unicode_emoji?(unquote(emoji)), do: true
end