DeleteValidator: Improve code readability
authorLain Soykaf <lain@soykaf.club>
Sun, 3 May 2020 10:19:01 +0000 (12:19 +0200)
committerLain Soykaf <lain@soykaf.club>
Sun, 3 May 2020 10:19:01 +0000 (12:19 +0200)
lib/pleroma/web/activity_pub/object_validators/delete_validator.ex

index 256ac70b613df31795f4e5db143c150bc1b2faf3..68ab08605962a811183c3a77bdad2dfd25cf369b 100644 (file)
@@ -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