mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 08:26:15 -06:00
only populate the status edits when specifically requested
This commit is contained in:
parent
a2d2443103
commit
7f866b36b8
4 changed files with 34 additions and 13 deletions
|
|
@ -60,6 +60,12 @@ func (p *Processor) Edit(
|
|||
)
|
||||
}
|
||||
|
||||
// We need the status populated including all historical edits.
|
||||
if err := p.state.DB.PopulateStatusEdits(ctx, status); err != nil {
|
||||
err := gtserror.Newf("error getting status edits from db: %w", err)
|
||||
return nil, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
// Time of edit.
|
||||
now := time.Now()
|
||||
|
||||
|
|
@ -337,9 +343,14 @@ func (p *Processor) HistoryGet(ctx context.Context, requester *gtsmodel.Account,
|
|||
return nil, errWithCode
|
||||
}
|
||||
|
||||
if err := p.state.DB.PopulateStatusEdits(ctx, target); err != nil {
|
||||
err := gtserror.Newf("error getting status edits from db: %w", err)
|
||||
return nil, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
edits, err := p.converter.StatusToAPIEdits(ctx, target)
|
||||
if err != nil {
|
||||
err := gtserror.Newf("error converting status: %w", err)
|
||||
err := gtserror.Newf("error converting status edits: %w", err)
|
||||
return nil, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue