forked from mirrors/gotosocial
No need for published
field to be strictly present
This commit is contained in:
parent
9a291dea84
commit
120510ccbf
1 changed files with 5 additions and 2 deletions
|
@ -22,6 +22,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/ap"
|
"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.
|
// Extract published time for the boost.
|
||||||
published, err := ap.ExtractPublished(announceable)
|
published, err := ap.ExtractPublished(announceable)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = gtserror.Newf("error extracting published: %w", err)
|
// If not available, use the current time.
|
||||||
return nil, isNew, err
|
published = time.Now().UTC()
|
||||||
|
//err = gtserror.Newf("error extracting published: %w", err)
|
||||||
|
//return nil, isNew, err
|
||||||
}
|
}
|
||||||
status.CreatedAt = published
|
status.CreatedAt = published
|
||||||
status.UpdatedAt = published
|
status.UpdatedAt = published
|
||||||
|
|
Loading…
Reference in a new issue