1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.Recipients do
8 alias Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectID
10 def type, do: {:array, ObjectID}
12 def cast(object) when is_binary(object) do
16 def cast(data) when is_list(data) do
18 |> Enum.reduce_while({:ok, []}, fn element, {:ok, list} ->
19 case ObjectID.cast(element) do
21 {:cont, {:ok, [id | list]}}