From 120510ccbfd32f2c2981f28e8d08ed318b371f30 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Mon, 7 Aug 2023 19:05:21 +0200 Subject: [PATCH] No need for `published` field to be strictly present --- internal/typeutils/astointernal.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go index 9b255213..0833a3ae 100644 --- a/internal/typeutils/astointernal.go +++ b/internal/typeutils/astointernal.go @@ -22,6 +22,7 @@ import ( "errors" "fmt" "net/url" + "time" "github.com/miekg/dns" "github.com/superseriousbusiness/gotosocial/internal/ap" @@ -630,8 +631,10 @@ func (c *converter) ASAnnounceToStatus(ctx context.Context, announceable ap.Anno // Extract published time for the boost. published, err := ap.ExtractPublished(announceable) if err != nil { - err = gtserror.Newf("error extracting published: %w", err) - return nil, isNew, err + // If not available, use the current time. + published = time.Now().UTC() + //err = gtserror.Newf("error extracting published: %w", err) + //return nil, isNew, err } status.CreatedAt = published status.UpdatedAt = published