Now the filter context finally makes sense!

This commit is contained in:
LucasGGamerM 2023-02-03 15:24:36 -03:00
parent e223bdd2bd
commit 0ee99fa709
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ public abstract class StatusDisplayItem{
StatusFilterPredicate filterPredicate = new StatusFilterPredicate(filters);
if(!statusForContent.filterRevealed){
statusForContent.filterRevealed = filterPredicate.testWithWarning(status);
statusForContent.filterRevealed = filterPredicate.testWithWarning(status, filterContext);
}

View File

@ -39,7 +39,7 @@ public class StatusFilterPredicate implements Predicate<Status>{
return true;
}
public boolean testWithWarning(Status status) {
public boolean testWithWarning(Status status, Filter.FilterContext filterContext) {
if(status.filtered!=null){
if (status.filtered.isEmpty()){
return true;
@ -47,7 +47,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.WARN);
.anyMatch(filter->filter.filterAction==Filter.FilterAction.WARN && filter.context.contains(filterContext));
return !matches;
}
for(Filter filter:filters){