mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-12 14:04:08 +00:00
Transmogrifier: Keep likes as likes if the content is obviously wrong
This commit is contained in:
parent
950bf60765
commit
f9bff8f5e5
2 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue