mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 09:17:30 -06:00
[feature] add support for polls + receiving federated status edits (#2330)
This commit is contained in:
parent
7204ccedc3
commit
e9e5dc5a40
84 changed files with 3992 additions and 570 deletions
|
|
@ -154,17 +154,6 @@ func (s *statusDB) PopulateStatus(ctx context.Context, status *gtsmodel.Status)
|
|||
}
|
||||
}
|
||||
|
||||
if status.InReplyToID != "" && status.InReplyTo == nil {
|
||||
// Status parent is not set, fetch from database.
|
||||
status.InReplyTo, err = s.GetStatusByID(
|
||||
gtscontext.SetBarebones(ctx),
|
||||
status.InReplyToID,
|
||||
)
|
||||
if err != nil {
|
||||
errs.Appendf("error populating status parent: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if status.InReplyToID != "" {
|
||||
if status.InReplyTo == nil {
|
||||
// Status parent is not set, fetch from database.
|
||||
|
|
@ -213,6 +202,17 @@ func (s *statusDB) PopulateStatus(ctx context.Context, status *gtsmodel.Status)
|
|||
}
|
||||
}
|
||||
|
||||
if status.PollID != "" && status.Poll == nil {
|
||||
// Status poll is not set, fetch from database.
|
||||
status.Poll, err = s.state.DB.GetPollByID(
|
||||
gtscontext.SetBarebones(ctx),
|
||||
status.PollID,
|
||||
)
|
||||
if err != nil {
|
||||
errs.Appendf("error populating status poll: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if !status.AttachmentsPopulated() {
|
||||
// Status attachments are out-of-date with IDs, repopulate.
|
||||
status.Attachments, err = s.state.DB.GetAttachmentsByIDs(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue