diff --git a/lib/Service/GoogleCalendarAPIService.php b/lib/Service/GoogleCalendarAPIService.php
index e56b2056..fb079a8f 100644
--- a/lib/Service/GoogleCalendarAPIService.php
+++ b/lib/Service/GoogleCalendarAPIService.php
@@ -24,6 +24,7 @@
use Ortic\ColorConverter\Colors\Named;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Exception\BadRequest;
+use Sabre\DAV\PropPatch;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Reader;
@@ -320,6 +321,9 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
$calendarIsNew = is_null($ncCalId);
if (is_null($ncCalId)) {
$ncCalId = $this->caldavBackend->createCalendar('principals/users/' . $userId, $newCalUri, $params);
+ // Ensures the right name is given to the calendar
+ $proppatch = new PropPatch(['{DAV:}displayname' => $newCalName]);
+ $this->caldavBackend->updateCalendar($ncCalId, $proppatch);
}
// get color list
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index a96d5b28..16d1548b 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -89,12 +89,14 @@
caldavBackend]]>
caldavBackend]]>
caldavBackend]]>
+ caldavBackend]]>
+