diff options
-rw-r--r-- | lib/private/Activity/Manager.php | 8 | ||||
-rw-r--r-- | lib/public/Activity/ActivitySettings.php | 22 |
2 files changed, 26 insertions, 4 deletions
diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index 325f19bb7f1..cbe2d8c3eee 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -271,9 +271,11 @@ class Manager implements IManager { /** @var ISetting $setting */ $setting = \OC::$server->query($class); - if ($setting instanceof ISetting) { - $setting = new ActivitySettingsAdapter($setting); - } elseif (!$setting instanceof ActivitySettings) { + if (!$setting instanceof ISetting) { + if (!$setting instanceof ActivitySettings) { + $setting = new ActivitySettingsAdapter($setting); + } + } else { throw new \InvalidArgumentException('Invalid activity filter registered'); } diff --git a/lib/public/Activity/ActivitySettings.php b/lib/public/Activity/ActivitySettings.php index ad2e0918147..98b95061cd7 100644 --- a/lib/public/Activity/ActivitySettings.php +++ b/lib/public/Activity/ActivitySettings.php @@ -26,7 +26,7 @@ namespace OCP\Activity; /** * @since 20.0.0 */ -abstract class ActivitySettings { +abstract class ActivitySettings implements ISetting { /** * @return string Lowercase a-z and underscore only identifier * @since 20.0.0 @@ -78,4 +78,24 @@ abstract class ActivitySettings { public function isDefaultEnabledNotification() { return $this->isDefaultEnabledMail() && !$this->canChangeMail(); } + + /** + * Left in for backwards compatibility + * + * @return bool + * @since 20.0.0 + */ + public function canChangeStream() { + return false; + } + + /** + * Left in for backwards compatibility + * + * @return bool + * @since 20.0.0 + */ + public function isDefaultEnabledStream() { + return true; + } } |