diff options
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Command/CreateCalendar.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Principal.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/RootCollection.php | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/apps/dav/lib/Command/CreateCalendar.php b/apps/dav/lib/Command/CreateCalendar.php index 4d2012b0d39..1d818809245 100644 --- a/apps/dav/lib/Command/CreateCalendar.php +++ b/apps/dav/lib/Command/CreateCalendar.php @@ -87,7 +87,8 @@ class CreateCalendar extends Command { \OC::$server->getAppManager(), \OC::$server->query(ProxyMapper::class), \OC::$server->get(KnownUserService::class), - \OC::$server->getConfig() + \OC::$server->getConfig(), + \OC::$server->getL10NFactory(), ); $random = \OC::$server->getSecureRandom(); $logger = \OC::$server->getLogger(); diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 5e81e155d74..4a422fa9628 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -50,6 +50,7 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; +use OCP\L10N\IFactory; use OCP\Share\IManager as IShareManager; use Sabre\DAV\Exception; use Sabre\DAV\PropPatch; @@ -89,6 +90,8 @@ class Principal implements BackendInterface { /** @var IConfig */ private $config; + /** @var IFactory */ + private $languageFactory; public function __construct(IUserManager $userManager, IGroupManager $groupManager, @@ -98,6 +101,7 @@ class Principal implements BackendInterface { ProxyMapper $proxyMapper, KnownUserService $knownUserService, IConfig $config, + IFactory $languageFactory, string $principalPrefix = 'principals/users/') { $this->userManager = $userManager; $this->groupManager = $groupManager; @@ -109,6 +113,7 @@ class Principal implements BackendInterface { $this->proxyMapper = $proxyMapper; $this->knownUserService = $knownUserService; $this->config = $config; + $this->languageFactory = $languageFactory; } use PrincipalProxyTrait { @@ -508,6 +513,7 @@ class Principal implements BackendInterface { 'uri' => $this->principalPrefix . '/' . $userId, '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, '{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL', + '{http://nextcloud.com/ns}language' => $this->languageFactory->getUserLanguage($user), ]; $email = $user->getEMailAddress(); diff --git a/apps/dav/lib/RootCollection.php b/apps/dav/lib/RootCollection.php index aa81d2ff222..8d921414d51 100644 --- a/apps/dav/lib/RootCollection.php +++ b/apps/dav/lib/RootCollection.php @@ -73,7 +73,8 @@ class RootCollection extends SimpleCollection { \OC::$server->getAppManager(), $proxyMapper, \OC::$server->get(KnownUserService::class), - \OC::$server->getConfig() + \OC::$server->getConfig(), + \OC::$server->getL10NFactory() ); $groupPrincipalBackend = new GroupPrincipalBackend($groupManager, $userSession, $shareManager, $config); $calendarResourcePrincipalBackend = new ResourcePrincipalBackend($db, $userSession, $groupManager, $logger, $proxyMapper); |