Check if item is active and added global items

This commit is contained in:
Tim203 2021-06-08 12:53:00 +02:00
parent 68cd2eb4f1
commit acc3a8222a
No known key found for this signature in database
GPG key ID: 064EE9F5BF7C3EE8
2 changed files with 9 additions and 1 deletions

View file

@ -100,6 +100,10 @@ public final class NewsItem {
return project;
}
public boolean isGlobal() {
return "all".equals(getProject());
}
public boolean isActive() {
return active;
}

View file

@ -142,7 +142,11 @@ public class NewsHandler {
return;
}
if (!Constants.NEWS_PROJECT_LIST.contains(item.getProject())) {
if (!item.isActive()) {
return;
}
if (!item.isGlobal() && !Constants.NEWS_PROJECT_LIST.contains(item.getProject())) {
return;
}