X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Fmrf%2Factivity_expiration_policy.ex;h=5f412566d4e1d5f46f6ca89be2f8a505e934d214;hb=5d4c291d526e023e0fd769af623fc243fc067626;hp=655a2ced06034927fd83d2f4bc7aafcbccffe90e;hpb=3cd7ea693fa820c04257b893725100eccf1cc96c;p=akkoma
diff --git a/lib/pleroma/web/activity_pub/mrf/activity_expiration_policy.ex b/lib/pleroma/web/activity_pub/mrf/activity_expiration_policy.ex
index 655a2ced0..5f412566d 100644
--- a/lib/pleroma/web/activity_pub/mrf/activity_expiration_policy.ex
+++ b/lib/pleroma/web/activity_pub/mrf/activity_expiration_policy.ex
@@ -1,10 +1,10 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy do
- @moduledoc "Adds expiration to all local Create activities"
- @behaviour Pleroma.Web.ActivityPub.MRF
+ @moduledoc "Adds expiration to all local Create/Update activities"
+ @behaviour Pleroma.Web.ActivityPub.MRF.Policy
@impl true
def filter(activity) do
@@ -25,8 +25,13 @@ defmodule Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy do
String.starts_with?(actor, Pleroma.Web.Endpoint.url())
end
- defp note?(activity) do
- match?(%{"type" => "Create", "object" => %{"type" => "Note"}}, activity)
+ defp note?(%{"type" => type, "object" => %{"type" => "Note"}})
+ when type in ["Create", "Update"] do
+ true
+ end
+
+ defp note?(_) do
+ false
end
defp maybe_add_expiration(activity) do