AntiMentionSpamPolicy: fix user age check
This commit is contained in:
parent
5e963736ce
commit
64cacc3694
|
@ -12,9 +12,8 @@ defp user_has_followers?(%User{} = u), do: u.follower_count > 0
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue