Skip to content

Commit 14dd067

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 31cbd6a commit 14dd067

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

apps/dav/lib/Controller/OutOfOfficeController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public function getOutOfOffice(string $userId): DataResponse {
107107
* @param string $status Short text that is set as user status during the absence
108108
* @param string $message Longer multiline message that is shown to others during the absence
109109
* @param ?string $replacementUserId User id of the replacement user
110-
* @param ?string $replacementUserDisplayName Display name of the replacement user
111110
* @return DataResponse<Http::STATUS_OK, DAVOutOfOfficeData, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error: 'firstDay'|'statusLength'}, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, null, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}>
112111
*
113112
* 200: Absence data
@@ -122,8 +121,6 @@ public function setOutOfOffice(
122121
string $status,
123122
string $message,
124123
?string $replacementUserId,
125-
?string $replacementUserDisplayName
126-
127124
): DataResponse {
128125
$user = $this->userSession?->getUser();
129126
if ($user === null) {
@@ -133,6 +130,7 @@ public function setOutOfOffice(
133130
return new DataResponse(['error' => 'statusLength'], Http::STATUS_BAD_REQUEST);
134131
}
135132

133+
$replacementUser = null;
136134
if ($replacementUserId !== null) {
137135
$replacementUser = $this->userManager->get($replacementUserId);
138136
if ($replacementUser === null) {
@@ -153,7 +151,7 @@ public function setOutOfOffice(
153151
$status,
154152
$message,
155153
$replacementUserId,
156-
$replacementUserDisplayName
154+
$replacementUser?->getDisplayName()
157155
);
158156
$this->coordinator->clearCache($user->getUID());
159157

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ export default {
220220
status: this.status,
221221
message: this.message,
222222
replacementUserId: this.replacementUser?.user ?? null,
223-
replacementUserDisplayName: this.replacementUser?.displayName ?? 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)