Skip to content

Commit 903fd88

Browse files
authored
Merge pull request #342 from nextcloud/calendar_displayname
Fix calendar display name
2 parents 7bc0026 + 4b0988b commit 903fd88

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

lib/Service/GoogleCalendarAPIService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Ortic\ColorConverter\Colors\Named;
2525
use Psr\Log\LoggerInterface;
2626
use Sabre\DAV\Exception\BadRequest;
27+
use Sabre\DAV\PropPatch;
2728
use Sabre\VObject\Component\VCalendar;
2829
use Sabre\VObject\Component\VEvent;
2930
use Sabre\VObject\Reader;
@@ -320,6 +321,9 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
320321
$calendarIsNew = is_null($ncCalId);
321322
if (is_null($ncCalId)) {
322323
$ncCalId = $this->caldavBackend->createCalendar('principals/users/' . $userId, $newCalUri, $params);
324+
// Ensures the right name is given to the calendar
325+
$proppatch = new PropPatch(['{DAV:}displayname' => $newCalName]);
326+
$this->caldavBackend->updateCalendar($ncCalId, $proppatch);
323327
}
324328

325329
// get color list

psalm-baseline.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@
8989
<code><![CDATA[$this->caldavBackend]]></code>
9090
<code><![CDATA[$this->caldavBackend]]></code>
9191
<code><![CDATA[$this->caldavBackend]]></code>
92+
<code><![CDATA[$this->caldavBackend]]></code>
9293
<code><![CDATA[private]]></code>
9394
</MissingDependency>
9495
<UndefinedClass>
9596
<code><![CDATA[$ex]]></code>
9697
<code><![CDATA[$ex]]></code>
9798
<code><![CDATA[BadRequest]]></code>
99+
<code><![CDATA[PropPatch]]></code>
98100
<code><![CDATA[Reader]]></code>
99101
</UndefinedClass>
100102
<UndefinedDocblockClass>

0 commit comments

Comments
 (0)