Skip to content

Commit

Permalink
Merge pull request #25538 from owncloud/enable_fav_mails
Browse files Browse the repository at this point in the history
Activities: Enable Limit on favorites for Mail.
  • Loading branch information
Vincent Petry authored Jul 19, 2017
2 parents 17840e7 + 397343e commit d5fbc7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/files/lib/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ public function getNotificationTypes($languageCode) {
return [
self::TYPE_SHARE_CREATED => (string) $l->t('A new file or folder has been <strong>created</strong>'),
self::TYPE_SHARE_CHANGED => (string) $l->t('A file or folder has been <strong>changed</strong>'),
self::TYPE_FAVORITES => [
'desc' => (string) $l->t('Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>'),
'methods' => [self::METHOD_STREAM],
],
self::TYPE_FAVORITES => (string) $l->t('Limit notifications about creation and changes to your <strong>favorite files</strong>'),
self::TYPE_SHARE_DELETED => (string) $l->t('A file or folder has been <strong>deleted</strong>'),
self::TYPE_SHARE_RESTORED => (string) $l->t('A file or folder has been <strong>restored</strong>'),
];
Expand Down Expand Up @@ -420,6 +417,7 @@ public function getQueryForFilter($filter) {
* @return bool
*/
protected function userSettingFavoritesOnly($user) {
return (bool) $this->config->getUserValue($user, 'activity', 'notify_' . self::METHOD_STREAM . '_' . self::TYPE_FAVORITES, false);
return (bool)$this->config->getUserValue($user, 'activity', 'notify_' . self::METHOD_STREAM . '_' . self::TYPE_FAVORITES, false) ||
(bool)$this->config->getUserValue($user, 'activity', 'notify_' . self::METHOD_MAIL . '_' . self::TYPE_FAVORITES, false);
}
}
1 change: 1 addition & 0 deletions apps/files/tests/ActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function testNotificationTypes() {
$this->assertArrayHasKey(Activity::TYPE_SHARE_CREATED, $result);
$this->assertArrayHasKey(Activity::TYPE_SHARE_CHANGED, $result);
$this->assertArrayHasKey(Activity::TYPE_FAVORITES, $result);
$this->assertEquals($result[Activity::TYPE_FAVORITES], 'Limit notifications about creation and changes to your <strong>favorite files</strong>');
$this->assertArrayHasKey(Activity::TYPE_SHARE_DELETED, $result);
$this->assertArrayHasKey(Activity::TYPE_SHARE_RESTORED, $result);
}
Expand Down

0 comments on commit d5fbc7f

Please sign in to comment.