[#210] [TwitterAPI] Made actor be stored for uploads. Added ownership check
to `update_media` action. Added controller tests for `upload` and `update_media` actions. Refactoring.
This commit is contained in:
parent
53797d19c5
commit
848151f7cb
8 changed files with 120 additions and 40 deletions
|
|
@ -574,7 +574,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
|
||||
def upload(file, opts \\ []) do
|
||||
with {:ok, data} <- Upload.store(file, opts) do
|
||||
Repo.insert(%Object{data: data})
|
||||
obj_data = if opts[:actor], do: Map.put(data, "actor", opts[:actor]), else: data
|
||||
Repo.insert(%Object{data: obj_data})
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue