Transmogrifier: Keep likes as likes if the content is obviously wrong

This commit is contained in:
Lain Soykaf 2025-03-19 16:00:27 +04:00
parent 950bf60765
commit f9bff8f5e5
2 changed files with 5 additions and 3 deletions

View file

@ -495,10 +495,11 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
defp handle_incoming_normalized(
%{
"type" => "Like",
"content" => _
"content" => content
} = data,
options
) do
)
when is_binary(content) do
data
|> Map.put("type", "EmojiReact")
|> handle_incoming_normalized(options)

View file

@ -140,6 +140,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do
_actor = insert(:user, ap_id: data["actor"], local: false)
assert {:error, _} = Transmogrifier.handle_incoming(data)
assert {:ok, activity} = Transmogrifier.handle_incoming(data)
assert activity.data["type"] == "Like"
end
end