[#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
|
|
@ -93,12 +93,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
|||
end
|
||||
end
|
||||
|
||||
def ap_upload(%Plug.Upload{} = file, %User{} = user) do
|
||||
ActivityPub.upload(file, actor: User.ap_id(user))
|
||||
end
|
||||
|
||||
def upload(%Plug.Upload{} = file, %User{} = user, format \\ "xml") do
|
||||
{:ok, object} = ap_upload(file, user)
|
||||
{:ok, object} = ActivityPub.upload(file, actor: User.ap_id(user))
|
||||
|
||||
url = List.first(object.data["url"])
|
||||
href = url["href"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue