summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-02-17 14:20:53 +0100
committerlain <lain@soykaf.club>2018-02-17 14:20:53 +0100
commit5682e48a253e40791b0b723f8cebf605c9cf7b63 (patch)
tree186a7178ecfb6085619faf7806627060bed23f40
parent05ba6ca1b8a792dfaa8e636a964a09b766afb4d6 (diff)
downloadpleroma-5682e48a253e40791b0b723f8cebf605c9cf7b63.tar.gz
pleroma-5682e48a253e40791b0b723f8cebf605c9cf7b63.zip
ActivityPub: tags -> tag.
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex6
-rw-r--r--test/web/activity_pub/transmogrifier_test.exs4
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 @@ 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
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 @@ 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