add repeat boost filtering logic, update go-structr, general improvements

This commit is contained in:
kim 2025-04-07 17:46:17 +01:00
commit 50805fac53
10 changed files with 153 additions and 114 deletions

View file

@ -383,19 +383,21 @@ func (s *Surface) timelineStatus(
}
// Insert status to timeline cache regardless of
// if API model was successfully prepared or not.
timeline.InsertOne(status, apiModel)
// if API model was succesfully prepared or not.
repeatBoost := timeline.InsertOne(status, apiModel)
if apiModel != nil {
// Only send the status to user's stream if not
// filtered / muted, i.e. successfully prepared model.
s.Stream.Update(ctx, account, apiModel, streamType)
return true
if apiModel == nil {
// Status was
// filtered / muted.
return false
}
// Status was
// filtered / muted.
return false
if !repeatBoost {
// Only stream if not repeated boost of recent status.
s.Stream.Update(ctx, account, apiModel, streamType)
}
return true
}
// timelineAndNotifyStatusForTagFollowers inserts the status into the