mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 10:09:02 +00:00
DeleteValidator: Improve code readability
This commit is contained in:
parent
1ead5f49b8
commit
f20a1a27ef
|
@ -67,19 +67,17 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.DeleteValidator do
|
|||
end
|
||||
|
||||
defp same_domain?(cng) do
|
||||
actor_domain =
|
||||
actor_uri =
|
||||
cng
|
||||
|> get_field(:actor)
|
||||
|> URI.parse()
|
||||
|> (& &1.host).()
|
||||
|
||||
object_domain =
|
||||
object_uri =
|
||||
cng
|
||||
|> get_field(:object)
|
||||
|> URI.parse()
|
||||
|> (& &1.host).()
|
||||
|
||||
object_domain == actor_domain
|
||||
object_uri.host == actor_uri.host
|
||||
end
|
||||
|
||||
def validate_deletion_rights(cng) do
|
||||
|
|
Loading…
Reference in a new issue