mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-07 11:39:31 -06:00
federate status deletes properly
This commit is contained in:
parent
5d2b69c256
commit
197ef03ead
19 changed files with 154 additions and 143 deletions
|
|
@ -31,7 +31,7 @@ func (p *processor) Unfave(account *gtsmodel.Account, targetStatusID string) (*a
|
|||
}
|
||||
|
||||
l.Trace("going to see if status is visible")
|
||||
visible, err := p.db.StatusVisible(targetStatus, targetAccount, account, relevantAccounts) // requestingAccount might well be nil here, but StatusVisible knows how to take care of that
|
||||
visible, err := p.db.StatusVisible(targetStatus, account, relevantAccounts) // requestingAccount might well be nil here, but StatusVisible knows how to take care of that
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error seeing if status %s is visible: %s", targetStatus.ID, err))
|
||||
}
|
||||
|
|
@ -60,8 +60,7 @@ func (p *processor) Unfave(account *gtsmodel.Account, targetStatusID string) (*a
|
|||
|
||||
if toUnfave {
|
||||
// we had a fave, so take some action to get rid of it
|
||||
_, err = p.db.UnfaveStatus(targetStatus, account.ID)
|
||||
if err != nil {
|
||||
if err := p.db.DeleteWhere([]db.Where{{Key: "status_id", Value: targetStatus.ID}, {Key: "account_id", Value: account.ID}}, gtsFave); err != nil {
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error unfaveing status: %s", err))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue