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(
|
defp handle_incoming_normalized(
|
||||||
%{
|
%{
|
||||||
"type" => "Like",
|
"type" => "Like",
|
||||||
"content" => _
|
"content" => content
|
||||||
} = data,
|
} = data,
|
||||||
options
|
options
|
||||||
) do
|
)
|
||||||
|
when is_binary(content) do
|
||||||
data
|
data
|
||||||
|> Map.put("type", "EmojiReact")
|
|> Map.put("type", "EmojiReact")
|
||||||
|> handle_incoming_normalized(options)
|
|> handle_incoming_normalized(options)
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do
|
||||||
|
|
||||||
_actor = insert(:user, ap_id: data["actor"], local: false)
|
_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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue