Skip to content

Commit e8905db

Browse files
ChristophWurstnextcloud-command
authored andcommitted
fix(dav): Use IUser::getDisplayName directly
No need to send this from the client. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent a4760ef commit e8905db

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

apps/dav/lib/Controller/OutOfOfficeController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public function getOutOfOffice(string $userId): DataResponse {
106106
* @param string $status Short text that is set as user status during the absence
107107
* @param string $message Longer multiline message that is shown to others during the absence
108108
* @param ?string $replacementUserId User id of the replacement user
109-
* @param ?string $replacementUserDisplayName Display name of the replacement user
110109
* @return DataResponse<Http::STATUS_OK, DAVOutOfOfficeData, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error: 'firstDay'}, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, null, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}>
111110
*
112111
* 200: Absence data
@@ -121,14 +120,13 @@ public function setOutOfOffice(
121120
string $status,
122121
string $message,
123122
?string $replacementUserId,
124-
?string $replacementUserDisplayName,
125-
126123
): DataResponse {
127124
$user = $this->userSession?->getUser();
128125
if ($user === null) {
129126
return new DataResponse(null, Http::STATUS_UNAUTHORIZED);
130127
}
131128

129+
$replacementUser = null;
132130
if ($replacementUserId !== null) {
133131
$replacementUser = $this->userManager->get($replacementUserId);
134132
if ($replacementUser === null) {
@@ -149,7 +147,7 @@ public function setOutOfOffice(
149147
$status,
150148
$message,
151149
$replacementUserId,
152-
$replacementUserDisplayName
150+
$replacementUser?->getDisplayName()
153151
);
154152
$this->coordinator->clearCache($user->getUID());
155153

apps/dav/openapi.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,6 @@
730730
"type": "string",
731731
"nullable": true,
732732
"description": "User id of the replacement user"
733-
},
734-
"replacementUserDisplayName": {
735-
"type": "string",
736-
"nullable": true,
737-
"description": "Display name of the replacement user"
738733
}
739734
}
740735
}

apps/dav/src/components/AbsenceForm.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ export default {
219219
lastDay: formatDateAsYMD(this.lastDay),
220220
status: this.status,
221221
message: this.message,
222-
replacementUserId: this.replacementUser?.user ?? null,
223-
replacementUserDisplayName: this.replacementUser?.displayName ?? null,
222+
replacementUserId: this.replacementUser?.user ?? null
224223
})
225224
showSuccess(this.$t('dav', 'Absence saved'))
226225
} catch (error) {

dist/dav-settings-personal-availability.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dav-settings-personal-availability.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)