From 3b3824c48604725c31107b9f98911f2c592f76f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 24 Oct 2018 12:53:18 +0200 Subject: [PATCH 1/3] Use empty string instead of null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Accounts/AccountManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 7f177e9c65..a057cb4fc2 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -330,7 +330,7 @@ class AccountManager implements IAccountManager { private function parseAccountData(IUser $user, $data): Account { $account = new Account($user); foreach($data as $property => $accountData) { - $account->setProperty($property, $accountData['value'], $accountData['scope'], $accountData['verified']); + $account->setProperty($property, $accountData['value'] ?? '', $accountData['scope'], $accountData['verified']); } return $account; } From 86f29ffdbcc4500c738fd20bf253b20aafea3ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 24 Oct 2018 12:53:43 +0200 Subject: [PATCH 2/3] Register IAccountManager as a service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Server.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/Server.php b/lib/private/Server.php index e0bd808428..32d7705919 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -124,6 +124,7 @@ use OC\Dashboard\DashboardManager; use OCA\Theming\ImageManager; use OCA\Theming\ThemingDefaults; +use OCP\Accounts\IAccountManager; use OCP\App\IAppManager; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Collaboration\AutoComplete\IManager; @@ -1175,6 +1176,7 @@ class Server extends ServerContainer implements IServerContainer { ); }); $this->registerAlias(IContactsStore::class, ContactsStore::class); + $this->registerAlias(IAccountManager::class, AccountManager::class); $this->registerService(IStorageFactory::class, function() { return new StorageFactory(); From f47f5ad0ea86ff216dcbf898e7d17ece0225c01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 24 Oct 2018 12:54:01 +0200 Subject: [PATCH 3/3] Allow property filters to be null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/public/Accounts/IAccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/public/Accounts/IAccount.php b/lib/public/Accounts/IAccount.php index 0fa8f6e53e..6bf4988a9f 100644 --- a/lib/public/Accounts/IAccount.php +++ b/lib/public/Accounts/IAccount.php @@ -78,7 +78,7 @@ interface IAccount extends \JsonSerializable { * @param string $verified \OCP\Accounts\IAccountManager::NOT_VERIFIED | \OCP\Accounts\IAccountManager::VERIFICATION_IN_PROGRESS | \OCP\Accounts\IAccountManager::VERIFIED * @return IAccountProperty[] */ - public function getFilteredProperties(string $scope, string $verified): array; + public function getFilteredProperties(string $scope = null, string $verified = null): array; /** * Get the related user for the account data