[bugfix] Prevent future statuses entering timelines (#1134)

* [bugfix] Prevent future statuses entering timeline
Statuses created more than 5 minutes into the future are now rejected in the visibility package.

* Come on buddy
This commit is contained in:
tobi 2022-11-24 13:54:49 +01:00 committed by GitHub
commit da8954858a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 13 deletions

View file

@ -29,14 +29,10 @@ import (
)
func (f *filter) StatusVisible(ctx context.Context, targetStatus *gtsmodel.Status, requestingAccount *gtsmodel.Account) (bool, error) {
const getBoosted = true
l := log.WithFields(kv.Fields{
{"statusID", targetStatus.ID},
}...)
l := log.WithFields(kv.Fields{{"statusID", targetStatus.ID}}...)
// Fetch any relevant accounts for the target status
const getBoosted = true
relevantAccounts, err := f.relevantAccounts(ctx, targetStatus, getBoosted)
if err != nil {
l.Debugf("error pulling relevant accounts for status %s: %s", targetStatus.ID, err)