AntiMentionSpamPolicy: fix user age check

This commit is contained in:
Alex Gleason 2023-05-21 19:31:56 -05:00 committed by Mark Felder
parent 5e963736ce
commit 64cacc3694

View File

@ -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_posted?(%User{} = u), do: u.note_count > 0
defp user_has_age?(%User{} = u) do defp user_has_age?(%User{} = u) do
now = NaiveDateTime.utc_now() diff = NaiveDateTime.utc_now() |> NaiveDateTime.diff(u.inserted_at, :second)
diff = u.inserted_at |> NaiveDateTime.diff(now, :second) diff >= :timer.seconds(30)
diff > :timer.seconds(30)
end end
defp good_reputation?(%User{} = u) do defp good_reputation?(%User{} = u) do