mirror of
https://git.youjo.love/youjo/youjo-be.git
synced 2024-11-20 05:49:54 +01:00
Allow mixed unicode + custom reactions
This commit is contained in:
parent
8490f686ac
commit
dcb171caf4
2 changed files with 17 additions and 3 deletions
|
@ -90,8 +90,10 @@ defmodule Pleroma.Web.ActivityPub.Builder do
|
||||||
Enum.find(
|
Enum.find(
|
||||||
existing_reactions,
|
existing_reactions,
|
||||||
fn [name, _, url] ->
|
fn [name, _, url] ->
|
||||||
url = URI.parse(url)
|
if url != nil do
|
||||||
url.host == instance && name == emoji_code
|
url = URI.parse(url)
|
||||||
|
url.host == instance && name == emoji_code
|
||||||
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,12 @@ defmodule Pleroma.Web.PleromaAPI.EmojiReactionControllerTest do
|
||||||
note =
|
note =
|
||||||
insert(:note,
|
insert(:note,
|
||||||
user: user,
|
user: user,
|
||||||
data: %{"reactions" => [["wow", [other_user.ap_id], "https://remote/emoji/wow"]]}
|
data: %{
|
||||||
|
"reactions" => [
|
||||||
|
["👍", [other_user.ap_id], nil],
|
||||||
|
["wow", [other_user.ap_id], "https://remote/emoji/wow"]
|
||||||
|
]
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
activity = insert(:note_activity, note: note, user: user)
|
activity = insert(:note_activity, note: note, user: user)
|
||||||
|
@ -89,6 +94,13 @@ defmodule Pleroma.Web.PleromaAPI.EmojiReactionControllerTest do
|
||||||
|> json_response(200)
|
|> json_response(200)
|
||||||
|
|
||||||
assert result["pleroma"]["emoji_reactions"] == [
|
assert result["pleroma"]["emoji_reactions"] == [
|
||||||
|
%{
|
||||||
|
"account_ids" => [other_user.id],
|
||||||
|
"count" => 1,
|
||||||
|
"me" => false,
|
||||||
|
"name" => "👍",
|
||||||
|
"url" => nil
|
||||||
|
},
|
||||||
%{
|
%{
|
||||||
"name" => "wow@remote",
|
"name" => "wow@remote",
|
||||||
"count" => 2,
|
"count" => 2,
|
||||||
|
|
Loading…
Reference in a new issue