mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature/frontend] Hide "engagement" stats, edits, and other info under a little drop down to unclutter status info bar (#4021)
* dick about with stats a bit * more dicking abuot * lil tweaks * more about-dicking * weee * comments * fixie uppie
This commit is contained in:
@ -1217,6 +1217,45 @@ func (c *Converter) StatusToWebStatus(
|
||||
// Mark local.
|
||||
webStatus.Local = *s.Local
|
||||
|
||||
// Get edit history for this
|
||||
// status, if it's been edited.
|
||||
if webStatus.EditedAt != nil {
|
||||
// Make sure edits are populated.
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
// Include each historical entry
|
||||
// (this includes the created date).
|
||||
for _, edit := range s.Edits {
|
||||
webStatus.EditTimeline = append(
|
||||
webStatus.EditTimeline,
|
||||
util.FormatISO8601(edit.CreatedAt),
|
||||
)
|
||||
}
|
||||
|
||||
// Make sure to include latest revision.
|
||||
webStatus.EditTimeline = append(
|
||||
webStatus.EditTimeline,
|
||||
*webStatus.EditedAt,
|
||||
)
|
||||
|
||||
// Sort the slice so it goes from
|
||||
// newest -> oldest, like a timeline.
|
||||
//
|
||||
// It'll look something like:
|
||||
//
|
||||
// - edit3 date (ie., latest version)
|
||||
// - edit2 date (if we have it)
|
||||
// - edit1 date (if we have it)
|
||||
// - created date
|
||||
slices.Reverse(webStatus.EditTimeline)
|
||||
}
|
||||
|
||||
// Set additional templating
|
||||
// variables on media attachments.
|
||||
|
||||
|
Reference in New Issue
Block a user