summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-07-23 16:39:27 +0200
committerRobin Appelman <robin@icewind.nl>2020-07-24 13:03:35 +0200
commitc8427781b4524b3eb9bf792227f44587aceb703a (patch)
tree50a66cd4a70b0eaf78a04edb44d0f5f9f477d466 /lib
parent5eb1e75e243917047cdb4b122a54fcd6a6d510af (diff)
downloadnextcloud-server-c8427781b4524b3eb9bf792227f44587aceb703a.tar.gz
nextcloud-server-c8427781b4524b3eb9bf792227f44587aceb703a.zip
implement old settings interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Activity/Manager.php8
-rw-r--r--lib/public/Activity/ActivitySettings.php22
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;
+ }
}