From e998d6d89148ef1ab129ca462399495b39f64139 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Tue, 13 Jun 2017 09:33:25 +0200
Subject: [PATCH] OO-2816: filter wiki/blog/podcast notifications

---
 .../webFeed/managers/FeedNotificationsHandler.java       | 9 ++++-----
 .../wiki/WikiPageChangeOrCreateNotificationHandler.java  | 1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/olat/modules/webFeed/managers/FeedNotificationsHandler.java b/src/main/java/org/olat/modules/webFeed/managers/FeedNotificationsHandler.java
index 708c7b11394..80ce72daab6 100644
--- a/src/main/java/org/olat/modules/webFeed/managers/FeedNotificationsHandler.java
+++ b/src/main/java/org/olat/modules/webFeed/managers/FeedNotificationsHandler.java
@@ -80,13 +80,12 @@ public abstract class FeedNotificationsHandler implements NotificationsHandler {
 				try {
 					RepositoryEntry re = repoManager.lookupRepositoryEntry(
 							OresHelper.createOLATResourceableInstance(p.getResName(), p.getResId()), false);
+					if (re.getAccess() == RepositoryEntry.DELETED || re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+						return notificationsManager.getNoSubscriptionInfo();
+					}
 					String displayName = re.getDisplayname();
 					if("CourseModule".equals(p.getResName())) {
-						if (re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
-							return notificationsManager.getNoSubscriptionInfo();
-						} else {
-							title = translator.translate(NOTIFICATIONS_HEADER_COURSE,  new String[]{displayName});
-						}
+						title = translator.translate(NOTIFICATIONS_HEADER_COURSE,  new String[]{displayName});
 					} else {
 						title = getHeader(translator, displayName);
 					}
diff --git a/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java b/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java
index 2f305e2da43..5083eba9447 100644
--- a/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java
+++ b/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java
@@ -213,6 +213,7 @@ public class WikiPageChangeOrCreateNotificationHandler implements NotificationsH
 	
 	private boolean courseStatus(ICourse course) {
 		return course != null
+				&& course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getAccess() !=  RepositoryEntry.DELETED
 				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isUnpublished()
 				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed();
 	}
-- 
GitLab