Skip to content

Commit

Permalink
Fix displayName return of dav groups request
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Nov 10, 2018
1 parent cc96b93 commit a01711e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/dav/lib/DAV/GroupPrincipalBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,12 @@ function findByUri($uri, $principalPrefix) {
*/
protected function groupToPrincipal($group) {
$groupId = $group->getGID();
// getDisplayName returns UID if none
$displayName = $group->getDisplayName();

return [
'uri' => 'principals/groups/' . urlencode($groupId),
'{DAV:}displayname' => $this->l10n->t('%s (group)', [$groupId]),
'{DAV:}displayname' => $displayName,
'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'GROUP',
];
}
Expand All @@ -307,11 +309,12 @@ protected function groupToPrincipal($group) {
*/
protected function userToPrincipal($user) {
$userId = $user->getUID();
// getDisplayName returns UID if none
$displayName = $user->getDisplayName();

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

Expand Down

0 comments on commit a01711e

Please sign in to comment.