Merge branch 'develop' into feature/admin-api-user-statuses
authorMaxim Filippov <colixer@gmail.com>
Tue, 23 Jul 2019 23:42:28 +0000 (02:42 +0300)
committerMaxim Filippov <colixer@gmail.com>
Tue, 23 Jul 2019 23:42:28 +0000 (02:42 +0300)
1  2 
CHANGELOG.md
docs/api/admin_api.md
lib/pleroma/web/admin_api/admin_api_controller.ex
lib/pleroma/web/router.ex
test/support/factory.ex
test/web/admin_api/admin_api_controller_test.exs

diff --cc CHANGELOG.md
Simple merge
Simple merge
Simple merge
index d02bd9212ccb74f969bf1bcfd486c22f7d2fef51,1f4239213cadc877ed181782013f318f60826cf5..c751546ce46bbf4edc6aedd14b824b29f4f3286c
@@@ -118,18 -118,20 +118,21 @@@ defmodule Pleroma.Factory d
    def note_activity_factory(attrs \\ %{}) do
      user = attrs[:user] || insert(:user)
      note = attrs[:note] || insert(:note, user: user)
-     published = attrs[:published] || DateTime.utc_now() |> DateTime.to_iso8601()
-     attrs = Map.drop(attrs, [:user, :note])
 +
-     data = %{
-       "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
-       "type" => "Create",
-       "actor" => note.data["actor"],
-       "to" => note.data["to"],
-       "object" => note.data["id"],
-       "published" => published,
-       "context" => note.data["context"]
-     }
+     data_attrs = attrs[:data_attrs] || %{}
+     attrs = Map.drop(attrs, [:user, :note, :data_attrs])
+     data =
+       %{
+         "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
+         "type" => "Create",
+         "actor" => note.data["actor"],
+         "to" => note.data["to"],
+         "object" => note.data["id"],
+         "published" => DateTime.utc_now() |> DateTime.to_iso8601(),
+         "context" => note.data["context"]
+       }
+       |> Map.merge(data_attrs)
  
      %Pleroma.Activity{
        data: data,