ChatMessage: Tolerate attachment field set to an empty array
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3224
This commit is contained in:
parent
47e00524f7
commit
39dc6c65ef
3 changed files with 21 additions and 0 deletions
|
|
@ -57,6 +57,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatMessageValidator do
|
|||
|> Map.put("attachment", attachment)
|
||||
end
|
||||
|
||||
def fix_attachment(%{"attachment" => attachment} = data) when attachment == [] do
|
||||
data
|
||||
|> Map.drop(["attachment"])
|
||||
end
|
||||
|
||||
def fix_attachment(data), do: data
|
||||
|
||||
def changeset(struct, data) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue