mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] replace statuses.updated_at column with statuses.edited_at (#3636)
* update statuses table to replace updated_at column with edited_at * code comment * better code comments, fix setting of status + edit + mention + poll database times * fix log to logf call * fix status.EditIDs not being carried over in dereferencer.encrichStatus() * move status.EditID setting into handleStatusEdit()
This commit is contained in:
@@ -361,14 +361,12 @@ func (c *Converter) ASStatusToStatus(ctx context.Context, statusable ap.Statusab
|
||||
status.CreatedAt = time.Now()
|
||||
}
|
||||
|
||||
// status.Updated
|
||||
// status.Edited
|
||||
//
|
||||
// Extract and validate update time for status. Defaults to published.
|
||||
// Extract and validate update time for status. Defaults to none.
|
||||
if upd := ap.GetUpdated(statusable); !upd.Before(status.CreatedAt) {
|
||||
status.UpdatedAt = upd
|
||||
} else if upd.IsZero() {
|
||||
status.UpdatedAt = status.CreatedAt
|
||||
} else {
|
||||
status.EditedAt = upd
|
||||
} else if !upd.IsZero() {
|
||||
|
||||
// This is a malformed status that will likely break our systems.
|
||||
err := gtserror.Newf("status %s 'updated' predates 'published'", uri)
|
||||
@@ -649,9 +647,9 @@ func (c *Converter) ASAnnounceToStatus(
|
||||
// zero-time will fall back to db defaults.
|
||||
if pub := ap.GetPublished(announceable); !pub.IsZero() {
|
||||
boost.CreatedAt = pub
|
||||
boost.UpdatedAt = pub
|
||||
} else {
|
||||
log.Warnf(ctx, "unusable published property on %s", uri)
|
||||
boost.CreatedAt = time.Now()
|
||||
}
|
||||
|
||||
// Extract and load the boost actor account,
|
||||
|
Reference in New Issue
Block a user