mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-07 10:58:07 -06:00
more dicking abuot
This commit is contained in:
parent
60ee05d2a7
commit
6ef4cc36b2
9 changed files with 176 additions and 71 deletions
|
|
@ -166,6 +166,12 @@ type WebStatus struct {
|
|||
// after the "main" thread, so it and everything
|
||||
// below it can be considered "replies".
|
||||
ThreadFirstReply bool
|
||||
|
||||
// Sorted slice of StatusEdit times for
|
||||
// this status, from latest to oldest.
|
||||
// Only set if status has been edited.
|
||||
// Last entry is always creation time.
|
||||
EditTimeline []string `json:"-"`
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1217,6 +1217,31 @@ func (c *Converter) StatusToWebStatus(
|
|||
// Mark local.
|
||||
webStatus.Local = *s.Local
|
||||
|
||||
// Get edit history for this status.
|
||||
if webStatus.EditedAt != nil {
|
||||
if len(s.Edits) != len(s.EditIDs) {
|
||||
s.Edits, err = c.state.DB.GetStatusEditsByIDs(ctx, s.EditIDs)
|
||||
if err != nil && !errors.Is(err, db.ErrNoEntries) {
|
||||
err := gtserror.Newf("db error getting status edits: %w", err)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
for _, edit := range s.Edits {
|
||||
webStatus.EditTimeline = append(
|
||||
webStatus.EditTimeline,
|
||||
util.FormatISO8601(edit.CreatedAt),
|
||||
)
|
||||
}
|
||||
|
||||
webStatus.EditTimeline = append(
|
||||
webStatus.EditTimeline,
|
||||
*webStatus.EditedAt,
|
||||
)
|
||||
|
||||
slices.Reverse(webStatus.EditTimeline)
|
||||
}
|
||||
|
||||
// Set additional templating
|
||||
// variables on media attachments.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue