aboutsummaryrefslogtreecommitdiff
path: root/static/modules/no_incoming_deletes.ex
blob: 0c5d9e7505fd897aef658a065ed86e578f827bad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# THE "CLOUD" IS JUST SOMEONE ELSE'S COMPUTER
# have we been using the same internet?
defmodule Pleroma.Web.ActivityPub.MRF.NoIncomingDeletes do
        require Logger
	@behaviour Pleroma.Web.ActivityPub.MRF.Policy

	@impl true
	def filter(%{"type" => "Delete", "actor" => actor} = object) do
		actor_info = URI.parse(actor)
		if(actor_info.host == "annihilation.social") do
			Logger.warn("DELETE from ANNI, not rejecting:  #{inspect(object)}")
			{:ok, object}
		else
			Logger.warn("DELETE rejected: #{inspect(object)}")
			{:reject, object}
		end
	end

	@impl true
	def filter(object), do: {:ok, object}

	@impl true
	def describe, do: {:ok, %{}}
end