Merge pull request #18635 from owncloud/stickify-files-and-sharing-notification-types

Sticky the notification types of files and sharing
This commit is contained in:
Vincent Petry 2015-08-31 17:56:48 +02:00
commit 85b62c7d82
1 changed files with 13 additions and 1 deletions

View File

@ -244,15 +244,27 @@ class ActivityManager implements IManager {
* @return array * @return array
*/ */
public function getNotificationTypes($languageCode) { public function getNotificationTypes($languageCode) {
$filesNotificationTypes = [];
$sharingNotificationTypes = [];
$notificationTypes = array(); $notificationTypes = array();
foreach ($this->getExtensions() as $c) { foreach ($this->getExtensions() as $c) {
$result = $c->getNotificationTypes($languageCode); $result = $c->getNotificationTypes($languageCode);
if (is_array($result)) { 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); $notificationTypes = array_merge($notificationTypes, $result);
} }
} }
return $notificationTypes; return array_merge($filesNotificationTypes, $sharingNotificationTypes, $notificationTypes);
} }
/** /**