mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-23 17:54:22 +00:00
ActivityPub: tags -> tag.
This commit is contained in:
parent
05ba6ca1b8
commit
5682e48a25
|
@ -58,12 +58,12 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
mentions = object["to"]
|
||||
|> Enum.map(fn (ap_id) -> User.get_cached_by_ap_id(ap_id) end)
|
||||
|> Enum.filter(&(&1))
|
||||
|> Enum.map(fn(user) -> %{"type" => "mention", "href" => user.ap_id, "name" => "@#{user.nickname}"} end)
|
||||
|> Enum.map(fn(user) -> %{"type" => "Mention", "href" => user.ap_id, "name" => "@#{user.nickname}"} end)
|
||||
|
||||
tags = object["tags"] || []
|
||||
tags = object["tag"] || []
|
||||
|
||||
object
|
||||
|> Map.put("tags", tags ++ mentions)
|
||||
|> Map.put("tag", tags ++ mentions)
|
||||
end
|
||||
|
||||
def add_attributed_to(object) do
|
||||
|
|
|
@ -45,10 +45,10 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
expected_tag = %{
|
||||
"href" => other_user.ap_id,
|
||||
"name" => "@#{other_user.nickname}",
|
||||
"type" => "mention"
|
||||
"type" => "Mention"
|
||||
}
|
||||
|
||||
assert Enum.member?(object["tags"], expected_tag)
|
||||
assert Enum.member?(object["tag"], expected_tag)
|
||||
end
|
||||
|
||||
test "it adds the json-ld context" do
|
||||
|
|
Loading…
Reference in a new issue