New mix tasks for controlling user confirmation status and sending confirmation mails
[akkoma] / lib / pleroma / activity_expiration.ex
index 84edf68ef3e3f20a20bc3169ac9a3b4639d253cd..955f0578ee65ed896907dfb1df35fd58c99437f3 100644 (file)
@@ -47,7 +47,11 @@ defmodule Pleroma.ActivityExpiration do
     ActivityExpiration
     |> where([exp], exp.scheduled_at < ^naive_datetime)
     |> limit(50)
+    |> preload(:activity)
     |> Repo.all()
+    |> Enum.reject(fn %{activity: activity} ->
+      Activity.pinned_by_actor?(activity)
+    end)
   end
 
   def validate_scheduled_at(changeset, false), do: changeset