activitypub: upload: pass through an upload limit if one is provided
This commit is contained in:
parent
fa483cd7c2
commit
167d3789a5
2 changed files with 9 additions and 3 deletions
|
|
@ -575,9 +575,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
|> Enum.reverse()
|
||||
end
|
||||
|
||||
def upload(file) do
|
||||
data = Upload.store(file, Application.get_env(:pleroma, :instance)[:dedupe_media])
|
||||
Repo.insert(%Object{data: data})
|
||||
def upload(file, size_limit \\ nil) do
|
||||
with data <-
|
||||
Upload.store(file, Application.get_env(:pleroma, :instance)[:dedupe_media], size_limit),
|
||||
false <- is_nil(data) do
|
||||
Repo.insert(%Object{data: data})
|
||||
end
|
||||
end
|
||||
|
||||
def user_data_from_user_object(data) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue