update progress + small fix

This commit is contained in:
tsmethurst 2021-06-17 17:58:50 +02:00
parent d1eff9503e
commit 3d69a879f0
2 changed files with 9 additions and 2 deletions

View File

@ -72,7 +72,7 @@
* [x] /api/v1/statuses POST (Create a new status)
* [x] /api/v1/statuses/:id GET (View an existing status)
* [x] /api/v1/statuses/:id DELETE (Delete a status)
* [ ] /api/v1/statuses/:id/context GET (View statuses above and below status ID)
* [x] /api/v1/statuses/:id/context GET (View statuses above and below status ID)
* [x] /api/v1/statuses/:id/reblogged_by GET (See who has reblogged a status)
* [x] /api/v1/statuses/:id/favourited_by GET (See who has faved a status)
* [x] /api/v1/statuses/:id/favourite POST (Fave a status)

View File

@ -28,7 +28,13 @@ func (f *filter) StatusHometimelineable(targetStatus *gtsmodel.Status, timelineO
return false, nil
}
// we don't want to timeline a reply to a status whose owner isn't followed by the requesting account
// Don't timeline a status whose parent hasn't been dereferenced yet or can't be dereferenced.
// If we have the reply to URI but don't have an ID for the replied-to account or the replied-to status in our database, we haven't dereferenced it yet.
if targetStatus.InReplyToURI != "" && (targetStatus.InReplyToID == "" || targetStatus.InReplyToAccountID == "") {
return false, nil
}
// if a status replies to an ID we know in the database, we need to make sure we also follow the replied-to status owner account
if targetStatus.InReplyToID != "" {
// pin the reply to status on to this status if it hasn't been done already
if targetStatus.GTSReplyToStatus == nil {
@ -59,6 +65,7 @@ func (f *filter) StatusHometimelineable(targetStatus *gtsmodel.Status, timelineO
return false, fmt.Errorf("StatusHometimelineable: error checking follow from account %s to account %s: %s", timelineOwnerAccount.ID, targetStatus.InReplyToAccountID, err)
}
// we don't want to timeline a reply to a status whose owner isn't followed by the requesting account
if !follows {
return false, nil
}