Require that ephemeral posts live for at least one hour

If we didn't put some kind of lifetime requirement on these, I guess you
could annoy people by sending large numbers of ephemeral posts that
provoke notifications but then disappear before anyone can read them.
This commit is contained in:
Mike Verdone 2019-07-23 16:33:45 +02:00
commit 36012ef6c1
4 changed files with 37 additions and 3 deletions

View file

@ -18,4 +18,10 @@ defmodule Pleroma.ActivityExpirationTest do
assert length(expirations) == 1
assert hd(expirations) == expiration_due
end
test "denies expirations that don't live long enough" do
activity = insert(:note_activity)
now = NaiveDateTime.utc_now()
assert {:error, _} = ActivityExpiration.create(activity, now)
end
end