ActivityPub: tags -> tag.
authorlain <lain@soykaf.club>
Sat, 17 Feb 2018 13:20:53 +0000 (14:20 +0100)
committerlain <lain@soykaf.club>
Sat, 17 Feb 2018 13:20:53 +0000 (14:20 +0100)
lib/pleroma/web/activity_pub/transmogrifier.ex
test/web/activity_pub/transmogrifier_test.exs

index 74d25786f3eec91bf0d313608bdf797eee34451d..c4b6a79e061a15afb6c6f3361d70b82bf1ad3ec4 100644 (file)
@@ -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
index 76dc6d4ad84f58a5dacf8549910aba520bb4315c..124a5703b4d10f6ebc56cbb3590db1adfd4d923c 100644 (file)
@@ -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