mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #51258 from nextcloud/fix/dav/use-iuser-displayname
fix(dav): Use IUser::getDisplayName directly
This commit is contained in:
commit
23ca17ffc5
5 changed files with 6 additions and 14 deletions
|
|
@ -107,7 +107,6 @@ class OutOfOfficeController extends OCSController {
|
|||
* @param string $status Short text that is set as user status during the absence
|
||||
* @param string $message Longer multiline message that is shown to others during the absence
|
||||
* @param ?string $replacementUserId User id of the replacement user
|
||||
* @param ?string $replacementUserDisplayName Display name of the replacement user
|
||||
* @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{}>
|
||||
*
|
||||
* 200: Absence data
|
||||
|
|
@ -122,8 +121,6 @@ class OutOfOfficeController extends OCSController {
|
|||
string $status,
|
||||
string $message,
|
||||
?string $replacementUserId,
|
||||
?string $replacementUserDisplayName,
|
||||
|
||||
): DataResponse {
|
||||
$user = $this->userSession?->getUser();
|
||||
if ($user === null) {
|
||||
|
|
@ -133,6 +130,7 @@ class OutOfOfficeController extends OCSController {
|
|||
return new DataResponse(['error' => 'statusLength'], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
$replacementUser = null;
|
||||
if ($replacementUserId !== null) {
|
||||
$replacementUser = $this->userManager->get($replacementUserId);
|
||||
if ($replacementUser === null) {
|
||||
|
|
@ -153,7 +151,7 @@ class OutOfOfficeController extends OCSController {
|
|||
$status,
|
||||
$message,
|
||||
$replacementUserId,
|
||||
$replacementUserDisplayName
|
||||
$replacementUser?->getDisplayName()
|
||||
);
|
||||
$this->coordinator->clearCache($user->getUID());
|
||||
|
||||
|
|
|
|||
|
|
@ -730,11 +730,6 @@
|
|||
"type": "string",
|
||||
"nullable": true,
|
||||
"description": "User id of the replacement user"
|
||||
},
|
||||
"replacementUserDisplayName": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"description": "Display name of the replacement user"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,8 +219,7 @@ export default {
|
|||
lastDay: formatDateAsYMD(this.lastDay),
|
||||
status: this.status,
|
||||
message: this.message,
|
||||
replacementUserId: this.replacementUser?.user ?? null,
|
||||
replacementUserDisplayName: this.replacementUser?.displayName ?? null,
|
||||
replacementUserId: this.replacementUser?.user ?? null
|
||||
})
|
||||
showSuccess(this.$t('dav', 'Absence saved'))
|
||||
} catch (error) {
|
||||
|
|
|
|||
4
dist/dav-settings-personal-availability.js
vendored
4
dist/dav-settings-personal-availability.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue