mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-13 04:17:27 -06:00
Add preview card storing to the database
This commit is contained in:
parent
85c32526f2
commit
6169351d22
12 changed files with 228 additions and 55 deletions
|
|
@ -297,6 +297,16 @@ func (s *statusDB) PopulateStatus(ctx context.Context, status *gtsmodel.Status)
|
|||
}
|
||||
}
|
||||
|
||||
if !status.CardPopulated() {
|
||||
status.Card, err = s.state.DB.GetCardByID(
|
||||
gtscontext.SetBarebones(ctx),
|
||||
status.CardID,
|
||||
)
|
||||
if err != nil {
|
||||
errs.Appendf("error populating status preview card: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if status.CreatedWithApplicationID != "" && status.CreatedWithApplication == nil {
|
||||
// Populate the status' expected CreatedWithApplication (not always set).
|
||||
// Don't error on ErrNoEntries, as the application may have been cleaned up.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue