diff options
author | Thomas Citharel <tcit@tcit.fr> | 2019-09-15 10:29:56 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2021-06-25 14:15:10 +0200 |
commit | f73478654dc39bae79aa6293a743d0bd7e0a7d9e (patch) | |
tree | ecbdfe130629228d25ab0eb919bdd62696b32d08 /apps/dav/lib | |
parent | 00edbc2adf4d9362041f5611c62967f5a70e5b7e (diff) | |
download | nextcloud-server-f73478654dc39bae79aa6293a743d0bd7e0a7d9e.tar.gz nextcloud-server-f73478654dc39bae79aa6293a743d0bd7e0a7d9e.zip |
Always provide theme color for default personal calendar
Before this calendar-color wasn't defined for default calendar
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/HookManager.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php index 3929fdabbd0..6886a62d8e9 100644 --- a/apps/dav/lib/HookManager.php +++ b/apps/dav/lib/HookManager.php @@ -31,6 +31,7 @@ namespace OCA\DAV; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\CardDAV\SyncService; +use OCP\Defaults; use OCP\IUser; use OCP\IUserManager; use OCP\Util; @@ -59,6 +60,9 @@ class HookManager { /** @var array */ private $addressBooksToDelete = []; + /** @var Defaults */ + private $themingDefaults; + /** @var EventDispatcherInterface */ private $eventDispatcher; @@ -66,11 +70,13 @@ class HookManager { SyncService $syncService, CalDavBackend $calDav, CardDavBackend $cardDav, + Defaults $themingDefaults, EventDispatcherInterface $eventDispatcher) { $this->userManager = $userManager; $this->syncService = $syncService; $this->calDav = $calDav; $this->cardDav = $cardDav; + $this->themingDefaults = $themingDefaults; $this->eventDispatcher = $eventDispatcher; } @@ -156,6 +162,7 @@ class HookManager { try { $this->calDav->createCalendar($principal, CalDavBackend::PERSONAL_CALENDAR_URI, [ '{DAV:}displayname' => CalDavBackend::PERSONAL_CALENDAR_NAME, + '{http://apple.com/ns/ical/}calendar-color' => $this->themingDefaults->getColorPrimary() ]); } catch (\Exception $ex) { \OC::$server->getLogger()->logException($ex); |