From 6ad4e33fabf4606f8a32da9cab70430a1deee65c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 20 Apr 2021 16:55:55 +0200 Subject: [PATCH] Suspended actors don't need refreshing Signed-off-by: Thomas Citharel --- lib/mobilizon/actors/actors.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mobilizon/actors/actors.ex b/lib/mobilizon/actors/actors.ex index 21dc47a8..aabdf21e 100644 --- a/lib/mobilizon/actors/actors.ex +++ b/lib/mobilizon/actors/actors.ex @@ -1282,11 +1282,13 @@ defmodule Mobilizon.Actors do @doc """ Whether the actor needs to be updated. - Local actors obviously don't need to be updated + Local actors obviously don't need to be updated, neither do suspended ones """ @spec needs_update?(Actor.t()) :: boolean def needs_update?(%Actor{domain: nil}), do: false + def needs_update?(%Actor{suspended: true}), do: false + def needs_update?(%Actor{last_refreshed_at: nil, domain: domain}) when not is_nil(domain), do: true