Signed-off-by: Joas Schilling <coding@schilljs.com>tags/v11.0RC2
@@ -59,6 +59,9 @@ use Sabre\VObject\Recur\EventIterator; | |||
*/ | |||
class CalDavBackend extends AbstractBackend implements SyncSupport, SubscriptionSupport, SchedulingSupport { | |||
const PERSONAL_CALENDAR_URI = 'personal'; | |||
const PERSONAL_CALENDAR_NAME = 'Personal'; | |||
/** | |||
* We need to specify a max date, because we need to stop *somewhere* | |||
* |
@@ -38,6 +38,10 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { | |||
if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) { | |||
$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Contact birthdays'); | |||
} | |||
if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI && | |||
$this->calendarInfo['{DAV:}displayname'] === CalDavBackend::PERSONAL_CALENDAR_NAME) { | |||
$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Personal'); | |||
} | |||
} | |||
/** |
@@ -21,7 +21,6 @@ | |||
*/ | |||
namespace OCA\DAV; | |||
use OCA\DAV\CalDAV\BirthdayService; | |||
use OCA\DAV\CalDAV\CalDavBackend; | |||
use OCA\DAV\CardDAV\CardDavBackend; | |||
use OCA\DAV\CardDAV\SyncService; | |||
@@ -124,8 +123,9 @@ class HookManager { | |||
$principal = 'principals/users/' . $user->getUID(); | |||
if ($this->calDav->getCalendarsForUserCount($principal) === 0) { | |||
try { | |||
$this->calDav->createCalendar($principal, 'personal', [ | |||
'{DAV:}displayname' => 'Personal']); | |||
$this->calDav->createCalendar($principal, CalDavBackend::PERSONAL_CALENDAR_URI, [ | |||
'{DAV:}displayname' => CalDavBackend::PERSONAL_CALENDAR_NAME, | |||
]); | |||
} catch (\Exception $ex) { | |||
\OC::$server->getLogger()->logException($ex); | |||
} |