Rename is_local to is_local?

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-16 15:48:34 +01:00
parent 5b85d96e06
commit 702c7fa6d4
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -76,7 +76,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
category: object["category"], category: object["category"],
visibility: visibility, visibility: visibility,
join_options: Map.get(object, "joinMode", "free"), join_options: Map.get(object, "joinMode", "free"),
local: is_local(object["id"]), local: is_local?(object["id"]),
options: options, options: options,
metadata: metadata, metadata: metadata,
status: object |> Map.get("ical:status", "CONFIRMED") |> String.downcase(), status: object |> Map.get("ical:status", "CONFIRMED") |> String.downcase(),
@ -287,7 +287,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
) )
end end
defp is_local(url) do @spec is_local?(String.t()) :: boolean()
defp is_local?(url) do
%URI{host: url_domain} = URI.parse(url) %URI{host: url_domain} = URI.parse(url)
%URI{host: local_domain} = URI.parse(Endpoint.url()) %URI{host: local_domain} = URI.parse(Endpoint.url())
url_domain == local_domain url_domain == local_domain