Only delete the default calendar setting when the default calendar

itself is deleted

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-04-05 20:57:26 +02:00
parent ebdf66b706
commit 0408c37b3d
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 4 additions and 1 deletions

View File

@ -255,8 +255,11 @@ class Application extends App {
$principalUri = $event->getArgument('calendarData')['principaluri'];
if (strpos($principalUri, 'principals/users') === 0) {
list(, $UID) = \Sabre\Uri\split($principalUri);
$uri = $event->getArgument('calendarData')['uri'];
if ($config->getUserValue($UID, 'dav', 'defaultCalendar') === $uri) {
$config->deleteUserValue($UID, 'dav', 'defaultCalendar');
}
}
});
}