[#210] Mastodon: actor storing for media uploads, ownership check to update_media.
Refactoring.
This commit is contained in:
parent
3b5be09f45
commit
3e90f688f1
6 changed files with 38 additions and 27 deletions
|
|
@ -574,7 +574,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
|
||||
def upload(file, opts \\ []) do
|
||||
with {:ok, data} <- Upload.store(file, opts) do
|
||||
obj_data = if opts[:actor], do: Map.put(data, "actor", opts[:actor]), else: data
|
||||
obj_data =
|
||||
if opts[:actor] do
|
||||
Map.put(data, "actor", opts[:actor])
|
||||
else
|
||||
data
|
||||
end
|
||||
|
||||
Repo.insert(%Object{data: obj_data})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue