forked from AkkomaGang/akkoma
DeleteValidator: Improve code readability
This commit is contained in:
parent
1ead5f49b8
commit
f20a1a27ef
1 changed files with 3 additions and 5 deletions
|
@ -67,19 +67,17 @@ def do_not_federate?(cng) do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp same_domain?(cng) do
|
defp same_domain?(cng) do
|
||||||
actor_domain =
|
actor_uri =
|
||||||
cng
|
cng
|
||||||
|> get_field(:actor)
|
|> get_field(:actor)
|
||||||
|> URI.parse()
|
|> URI.parse()
|
||||||
|> (& &1.host).()
|
|
||||||
|
|
||||||
object_domain =
|
object_uri =
|
||||||
cng
|
cng
|
||||||
|> get_field(:object)
|
|> get_field(:object)
|
||||||
|> URI.parse()
|
|> URI.parse()
|
||||||
|> (& &1.host).()
|
|
||||||
|
|
||||||
object_domain == actor_domain
|
object_uri.host == actor_uri.host
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_deletion_rights(cng) do
|
def validate_deletion_rights(cng) do
|
||||||
|
|
Loading…
Reference in a new issue