From 5682e48a253e40791b0b723f8cebf605c9cf7b63 Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 17 Feb 2018 14:20:53 +0100 Subject: [PATCH] ActivityPub: tags -> tag. --- lib/pleroma/web/activity_pub/transmogrifier.ex | 6 +++--- test/web/activity_pub/transmogrifier_test.exs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 74d25786f..c4b6a79e0 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -58,12 +58,12 @@ def add_mention_tags(object) 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 diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 76dc6d4ad..124a5703b 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -45,10 +45,10 @@ test "it turns mentions into tags" 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