Timeline improvements (#41)
Tidying up. Parent/child statuses now display correctly in status/id/context.
This commit is contained in:
@ -24,14 +24,8 @@ func (p *processor) Unfave(account *gtsmodel.Account, targetStatusID string) (*a
|
||||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error fetching target account %s: %s", targetStatus.AccountID, err))
|
||||
}
|
||||
|
||||
l.Trace("going to get relevant accounts")
|
||||
relevantAccounts, err := p.db.PullRelevantAccountsFromStatus(targetStatus)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error fetching related accounts for status %s: %s", targetStatusID, err))
|
||||
}
|
||||
|
||||
l.Trace("going to see if status is visible")
|
||||
visible, err := p.db.StatusVisible(targetStatus, account, relevantAccounts) // requestingAccount might well be nil here, but StatusVisible knows how to take care of that
|
||||
visible, err := p.filter.StatusVisible(targetStatus, account)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error seeing if status %s is visible: %s", targetStatus.ID, err))
|
||||
}
|
||||
@ -74,16 +68,7 @@ func (p *processor) Unfave(account *gtsmodel.Account, targetStatusID string) (*a
|
||||
}
|
||||
}
|
||||
|
||||
// return the status (whatever its state) back to the caller
|
||||
var boostOfStatus *gtsmodel.Status
|
||||
if targetStatus.BoostOfID != "" {
|
||||
boostOfStatus = >smodel.Status{}
|
||||
if err := p.db.GetByID(targetStatus.BoostOfID, boostOfStatus); err != nil {
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error fetching boosted status %s: %s", targetStatus.BoostOfID, err))
|
||||
}
|
||||
}
|
||||
|
||||
mastoStatus, err := p.tc.StatusToMasto(targetStatus, targetAccount, account, relevantAccounts.BoostedAccount, relevantAccounts.ReplyToAccount, boostOfStatus)
|
||||
mastoStatus, err := p.tc.StatusToMasto(targetStatus, account)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err))
|
||||
}
|
||||
|
Reference in New Issue
Block a user