DeleteValidator: Mastodon sends unaddressed deletes.
authorlain <lain@soykaf.club>
Thu, 30 Apr 2020 12:37:14 +0000 (14:37 +0200)
committerlain <lain@soykaf.club>
Thu, 30 Apr 2020 12:37:14 +0000 (14:37 +0200)
lib/pleroma/web/activity_pub/object_validators/delete_validator.ex
test/web/activity_pub/object_validator_test.exs

index 8dd5c19ad5b0e8c235c4218b5f7989ba7abf5df6..0eb31451cd650462aaedc494b05077e8056545e8 100644 (file)
@@ -32,7 +32,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.DeleteValidator do
     |> validate_inclusion(:type, ["Delete"])
     |> validate_same_domain()
     |> validate_object_presence()
-    |> validate_recipients_presence()
   end
 
   def validate_same_domain(cng) do
index 64b9ee1ec3bb94b59d0488bf8031d74495e8d71e..ab26d350135a1759ea1a65d6f7c78e0a9659b867 100644 (file)
@@ -59,20 +59,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
 
       assert {:actor, {"is not allowed to delete object", []}} in cng.errors
     end
-
-    test "it's invalid if all the recipient fields are empty", %{
-      valid_post_delete: valid_post_delete
-    } do
-      empty_recipients =
-        valid_post_delete
-        |> Map.put("to", [])
-        |> Map.put("cc", [])
-
-      {:error, cng} = ObjectValidator.validate(empty_recipients, [])
-
-      assert {:to, {"no recipients in any field", []}} in cng.errors
-      assert {:cc, {"no recipients in any field", []}} in cng.errors
-    end
   end
 
   describe "likes" do