fetcher: move local object checking into a reusable function

This commit is contained in:
rinpatch 2019-11-23 22:55:41 +03:00
commit 9f29930440
2 changed files with 5 additions and 1 deletions

View file

@ -255,4 +255,8 @@ defmodule Pleroma.Object do
|> Object.change(%{data: Map.merge(data || %{}, attrs)})
|> Repo.update()
end
def local?(%Object{data: %{"id" => id}}) do
String.starts_with?(id, Pleroma.Web.base_url() <> "/")
end
end