Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-11-14 14:52:05 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-11-21 12:11:57 +0300
commita805c8319f6f13dce845ad48d989e71cdc7610af (patch)
treeade2ae7dbd9410bb47d5ad6151766cbc60d12d64 /lib
parent8e8b9748486424825be0ab202b7fed05fb66749f (diff)
Add external avatars
* Memoize avatar url fetching promise for simple functional caching * Add extern avatars settings checkbox Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/Contracts/IUserPreferences.php1
-rw-r--r--lib/Controller/PreferencesController.php6
-rw-r--r--lib/Service/UserPreferenceSevice.php3
3 files changed, 8 insertions, 2 deletions
diff --git a/lib/Contracts/IUserPreferences.php b/lib/Contracts/IUserPreferences.php
index d953f461e..efaed8e45 100644
--- a/lib/Contracts/IUserPreferences.php
+++ b/lib/Contracts/IUserPreferences.php
@@ -31,6 +31,7 @@ interface IUserPreferences {
/**
* @param string $key
* @param mixed $value
+ * @return mixed new value
*/
public function setPreference($key, $value);
diff --git a/lib/Controller/PreferencesController.php b/lib/Controller/PreferencesController.php
index 9a5db350e..1e00a118d 100644
--- a/lib/Controller/PreferencesController.php
+++ b/lib/Controller/PreferencesController.php
@@ -74,9 +74,11 @@ class PreferencesController extends Controller {
throw new ClientException('key or value missing');
}
- $this->userPreference->setPreference($key, $value);
+ $newValue = $this->userPreference->setPreference($key, $value);
- return new JSONResponse();
+ return new JSONResponse([
+ 'value' => $newValue,
+ ]);
}
}
diff --git a/lib/Service/UserPreferenceSevice.php b/lib/Service/UserPreferenceSevice.php
index 5f45c8438..43614361c 100644
--- a/lib/Service/UserPreferenceSevice.php
+++ b/lib/Service/UserPreferenceSevice.php
@@ -24,6 +24,7 @@
namespace OCA\Mail\Service;
+use function is_bool;
use OCA\Mail\Contracts\IUserPreferences;
use OCP\IConfig;
@@ -47,9 +48,11 @@ class UserPreferenceSevice implements IUserPreferences {
/**
* @param string $key
* @param mixed $value
+ * @return mixed new value
*/
public function setPreference($key, $value) {
$this->config->setUserValue($this->UserId, 'mail', $key, $value);
+ return $value;
}
/**