Max media attachment count
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
60deddb7e5
commit
e473bcf7a0
6 changed files with 58 additions and 2 deletions
|
|
@ -112,7 +112,12 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
|
|||
|
||||
defp attachments(%{params: params} = draft) do
|
||||
attachments = Utils.attachments_from_ids(params)
|
||||
%__MODULE__{draft | attachments: attachments}
|
||||
draft = %__MODULE__{draft | attachments: attachments}
|
||||
|
||||
case Utils.validate_attachments_count(attachments) do
|
||||
:ok -> draft
|
||||
{:error, message} -> add_error(draft, message)
|
||||
end
|
||||
end
|
||||
|
||||
defp in_reply_to(%{params: %{in_reply_to_status_id: ""}} = draft), do: draft
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue