It now completely hides posts which have filters with warnings applied to them

This commit is contained in:
LucasGGamerM 2023-01-28 15:05:42 -03:00
parent c51f1be15c
commit ea8a4ae487
2 changed files with 3 additions and 1 deletions

View File

@ -60,6 +60,8 @@ public class Status extends BaseModel implements DisplayItemsParent{
public transient boolean spoilerRevealed;
public transient boolean hasGapAfter;
public transient boolean showFiltered = true;
private transient String strippedText;
@Override

View File

@ -29,7 +29,7 @@ public class StatusFilterPredicate implements Predicate<Status>{
boolean matches=status.filtered.stream()
.map(filterResult->filterResult.filter)
.filter(filter->filter.expiresAt==null||filter.expiresAt.isAfter(Instant.now()))
.anyMatch(filter->filter.filterAction==Filter.FilterAction.HIDE);
.anyMatch(filter->filter.filterAction==Filter.FilterAction.HIDE || filter.filterAction==Filter.FilterAction.WARN);
return !matches;
}
for(Filter filter:filters){