commit: 64cacc3694c0441d3f3f5886b301bbf93f590cb6
parent 5e963736cee55aa8f4bb9d9fba451ff3864ddaa8
Author: Alex Gleason <alex@alexgleason.me>
Date: Sun, 21 May 2023 19:31:56 -0500
AntiMentionSpamPolicy: fix user age check
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/pleroma/web/activity_pub/mrf/anti_mention_spam_policy.ex b/lib/pleroma/web/activity_pub/mrf/anti_mention_spam_policy.ex
@@ -12,9 +12,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiMentionSpamPolicy do
defp user_has_posted?(%User{} = u), do: u.note_count > 0
defp user_has_age?(%User{} = u) do
- now = NaiveDateTime.utc_now()
- diff = u.inserted_at |> NaiveDateTime.diff(now, :second)
- diff > :timer.seconds(30)
+ diff = NaiveDateTime.utc_now() |> NaiveDateTime.diff(u.inserted_at, :second)
+ diff >= :timer.seconds(30)
end
defp good_reputation?(%User{} = u) do