From 42f0651b8324be31d1ff31dad82194f81d748900 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Aug 2015 18:40:50 +0200 Subject: [PATCH] Sticky the notification types of files and sharing --- lib/private/activitymanager.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/private/activitymanager.php b/lib/private/activitymanager.php index a973db7206..fc25017353 100644 --- a/lib/private/activitymanager.php +++ b/lib/private/activitymanager.php @@ -244,15 +244,27 @@ class ActivityManager implements IManager { * @return array */ public function getNotificationTypes($languageCode) { + $filesNotificationTypes = []; + $sharingNotificationTypes = []; + $notificationTypes = array(); foreach ($this->getExtensions() as $c) { $result = $c->getNotificationTypes($languageCode); if (is_array($result)) { + if (class_exists('\OCA\Files\Activity') && $c instanceof \OCA\Files\Activity) { + $filesNotificationTypes = $result; + continue; + } + if (class_exists('\OCA\Files_Sharing\Activity') && $c instanceof \OCA\Files_Sharing\Activity) { + $sharingNotificationTypes = $result; + continue; + } + $notificationTypes = array_merge($notificationTypes, $result); } } - return $notificationTypes; + return array_merge($filesNotificationTypes, $sharingNotificationTypes, $notificationTypes); } /**