logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 06ce5e3b43b4a6809397bdb0eb192a82e7243e93
parent 1d0e3b1355c5a5883be1522f0f925c398c0e87a4
Author: Mark Felder <feld@feld.me>
Date:   Fri,  6 Sep 2024 11:27:07 -0400

Dialyzer: pattern_match The pattern can never match the type {:diff, false}.

Diffstat:

Mlib/pleroma/user/backup.ex11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/pleroma/user/backup.ex b/lib/pleroma/user/backup.ex @@ -118,14 +118,13 @@ defmodule Pleroma.User.Backup do end defp permitted?(user) do - with {_, %__MODULE__{inserted_at: inserted_at}} <- {:last, get_last(user)}, - days = Config.get([__MODULE__, :limit_days]), - diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days), - {_, true} <- {:diff, diff > days} do - true + with {_, %__MODULE__{inserted_at: inserted_at}} <- {:last, get_last(user)} do + days = Config.get([__MODULE__, :limit_days]) + diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days) + + diff > days else {:last, nil} -> true - {:diff, false} -> false end end