Admin API: Endpoint for fetching latest user's statuses

This commit is contained in:
Maxim Filippov 2019-07-14 00:37:19 +03:00
commit a9459ff98f
6 changed files with 67 additions and 1 deletions

View file

@ -118,7 +118,10 @@ defmodule Pleroma.Factory do
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])
require IEx
IEx.pry()
data = %{
"id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
@ -126,7 +129,7 @@ defmodule Pleroma.Factory do
"actor" => note.data["actor"],
"to" => note.data["to"],
"object" => note.data["id"],
"published" => DateTime.utc_now() |> DateTime.to_iso8601(),
"published" => published,
"context" => note.data["context"]
}