[bugfix] Move follow.show_reblogs check further up to avoid showing unwanted reblogs in home timeline (#2234)

This commit is contained in:
tobi 2023-09-29 10:39:35 +02:00 committed by GitHub
commit b6b8f82c87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 27 deletions

View file

@ -91,9 +91,13 @@ func (s *surface) timelineAndNotifyStatusForFollowers(
)
for _, follow := range follows {
// Do an initial rough-grained check to see if the
// status is timelineable for this follower at all
// based on its visibility and who it replies to etc.
// Check to see if the status is timelineable for this follower,
// taking account of its visibility, who it replies to, and, if
// it's a reblog, whether follower account wants to see reblogs.
//
// If it's not timelineable, we can just stop early, since lists
// are prettymuch subsets of the home timeline, so if it shouldn't
// appear there, it shouldn't appear in lists either.
timelineable, err := s.filter.StatusHomeTimelineable(
ctx, follow.Account, status,
)
@ -107,17 +111,6 @@ func (s *surface) timelineAndNotifyStatusForFollowers(
continue
}
if boost && !*follow.ShowReblogs {
// Status is a boost, but the owner of
// this follow doesn't want to see boosts
// from this account. We can safely skip
// everything, then, because we also know
// that the follow owner won't want to be
// have the status put in any list timelines,
// or be notified about the status either.
continue
}
// Add status to any relevant lists
// for this follow, if applicable.
s.listTimelineStatusForFollow(