More robust expires_at timestamp processing
authorMark Felder <feld@FreeBSD.org>
Tue, 29 Sep 2020 17:16:15 +0000 (12:16 -0500)
committerMark Felder <feld@FreeBSD.org>
Tue, 29 Sep 2020 17:27:47 +0000 (12:27 -0500)
lib/pleroma/user.ex

index 71ace1c34a51afc3ed93c22fd1e7e9b6126296ad..09ea8079391b6b8c7c882ee7d19778e58c1bce42 100644 (file)
@@ -2291,7 +2291,9 @@ defmodule Pleroma.User do
 
     # if pinned activity was scheduled for deletion, we reschedule it for deletion
     if data["expires_at"] do
-      {:ok, expires_at, _} = DateTime.from_iso8601(data["expires_at"])
+      # MRF.ActivityExpirationPolicy used UTC timestamps for expires_at in original implementation
+      {:ok, expires_at} =
+        data["expires_at"] |> Pleroma.EctoType.ActivityPub.ObjectValidators.DateTime.cast()
 
       Pleroma.Workers.PurgeExpiredActivity.enqueue(%{
         activity_id: id,