- def local_only?(activity) do
- recipients = Enum.concat(activity.data["to"], Map.get(activity.data, "cc", []))
- public = Pleroma.Constants.as_public()
- local = Pleroma.Web.base_url() <> "/#Public"
-
- Enum.member?(recipients, local) and not Enum.member?(recipients, public)
+ @spec get_by_object_ap_id_with_object(String.t()) :: t() | nil
+ def get_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
+ ap_id
+ |> Queries.by_object_id()
+ |> with_preloaded_object()
+ |> first()
+ |> Repo.one()