Add missing published field to Announce

This commit is contained in:
Rafael Caricio 2023-08-10 22:15:17 +02:00
parent af29c06290
commit b3194f1fee
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947

View file

@ -21,8 +21,6 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"net/url"
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/config"
@ -32,6 +30,8 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/log" "github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/uris" "github.com/superseriousbusiness/gotosocial/internal/uris"
"github.com/superseriousbusiness/gotosocial/internal/util" "github.com/superseriousbusiness/gotosocial/internal/util"
"net/url"
"time"
) )
func (c *converter) ASRepresentationToAccount(ctx context.Context, accountable ap.Accountable, accountDomain string) (*gtsmodel.Account, error) { func (c *converter) ASRepresentationToAccount(ctx context.Context, accountable ap.Accountable, accountDomain string) (*gtsmodel.Account, error) {
@ -630,8 +630,8 @@ 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) //err = gtserror.Newf("error extracting published: %w", err)
return nil, isNew, err published = time.Now().UTC()
} }
status.CreatedAt = published status.CreatedAt = published
status.UpdatedAt = published status.UpdatedAt = published