Skip to content

Commit

Permalink
Only delete the default calendar setting when the default calendar
Browse files Browse the repository at this point in the history
itself is deleted

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
  • Loading branch information
tcitworld committed Apr 13, 2020
1 parent ebdf66b commit 0408c37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/dav/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ public function registerHooks() {
$principalUri = $event->getArgument('calendarData')['principaluri'];
if (strpos($principalUri, 'principals/users') === 0) {
list(, $UID) = \Sabre\Uri\split($principalUri);
$config->deleteUserValue($UID, 'dav', 'defaultCalendar');
$uri = $event->getArgument('calendarData')['uri'];
if ($config->getUserValue($UID, 'dav', 'defaultCalendar') === $uri) {
$config->deleteUserValue($UID, 'dav', 'defaultCalendar');
}
}
});
}
Expand Down

0 comments on commit 0408c37

Please sign in to comment.