diff --git a/config/emoji.txt b/config/emoji.txt index 52b714ee5..1d13437c9 100644 --- a/config/emoji.txt +++ b/config/emoji.txt @@ -1,3 +1,4 @@ firefox, /emoji/Firefox.gif, Gif,Fun blank, /emoji/blank.png, Fun dinosaur, /emoji/dino walking.gif, Gif +100a, /emoji/100a.png, Fun diff --git a/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex b/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex index 995395826..f4870f580 100644 --- a/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex @@ -13,7 +13,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactValidator do import Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations @primary_key false - @emoji_regex ~r/:[A-Za-z_-]+:/ + @emoji_regex ~r/:[A-Za-z0-9_-]+:/ embedded_schema do quote do diff --git a/priv/static/emoji/100a.png b/priv/static/emoji/100a.png new file mode 100644 index 000000000..a608bf650 Binary files /dev/null and b/priv/static/emoji/100a.png differ diff --git a/test/pleroma/web/mastodon_api/views/notification_view_test.exs b/test/pleroma/web/mastodon_api/views/notification_view_test.exs index 00e90239e..31744a59d 100644 --- a/test/pleroma/web/mastodon_api/views/notification_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/notification_view_test.exs @@ -202,7 +202,7 @@ test "EmojiReact notification with custom emoji" do other_user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{status: "#morb"}) - {:ok, _activity} = CommonAPI.react_with_emoji(activity.id, other_user, ":dinosaur:") + {:ok, _activity} = CommonAPI.react_with_emoji(activity.id, other_user, ":100a:") activity = Repo.get(Activity, activity.id) @@ -214,8 +214,8 @@ test "EmojiReact notification with custom emoji" do id: to_string(notification.id), pleroma: %{is_seen: false, is_muted: false}, type: "pleroma:emoji_reaction", - emoji: ":dinosaur:", - emoji_url: "http://localhost:4001/emoji/dino walking.gif", + emoji: ":100a:", + emoji_url: "http://localhost:4001/emoji/100a.png", account: AccountView.render("show.json", %{user: other_user, for: user}), status: StatusView.render("show.json", %{activity: activity, for: user}), created_at: Utils.to_masto_date(notification.inserted_at)