Skip to content

Commit a01711e

Browse files
committed
Fix displayName return of dav groups request
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent cc96b93 commit a01711e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/dav/lib/DAV/GroupPrincipalBackend.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,12 @@ function findByUri($uri, $principalPrefix) {
293293
*/
294294
protected function groupToPrincipal($group) {
295295
$groupId = $group->getGID();
296+
// getDisplayName returns UID if none
297+
$displayName = $group->getDisplayName();
296298

297299
return [
298300
'uri' => 'principals/groups/' . urlencode($groupId),
299-
'{DAV:}displayname' => $this->l10n->t('%s (group)', [$groupId]),
301+
'{DAV:}displayname' => $displayName,
300302
'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'GROUP',
301303
];
302304
}
@@ -307,11 +309,12 @@ protected function groupToPrincipal($group) {
307309
*/
308310
protected function userToPrincipal($user) {
309311
$userId = $user->getUID();
312+
// getDisplayName returns UID if none
310313
$displayName = $user->getDisplayName();
311314

312315
$principal = [
313316
'uri' => 'principals/users/' . $userId,
314-
'{DAV:}displayname' => is_null($displayName) ? $userId : $displayName,
317+
'{DAV:}displayname' => $displayName,
315318
'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL',
316319
];
317320

0 commit comments

Comments
 (0)