Remove endpoint to get dark avatar, not necessary

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos 2022-11-11 20:19:15 -03:00 committed by Joas Schilling
parent 9be3867958
commit d014b4de14
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205
4 changed files with 3 additions and 22 deletions

View file

@ -34,8 +34,6 @@ return [
['name' => 'Avatar#uploadAvatar', 'url' => '/api/{apiVersion}/room/{token}/avatar', 'verb' => 'POST', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\AvatarController::getAvatar() */
['name' => 'Avatar#getAvatar', 'url' => '/api/{apiVersion}/room/{token}/avatar', 'verb' => 'GET', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\AvatarController::getAvatar() */
['name' => 'Avatar#getAvatarDark', 'url' => '/api/{apiVersion}/room/{token}/avatar/dark', 'verb' => 'GET', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\AvatarController::deleteAvatar() */
['name' => 'Avatar#deleteAvatar', 'url' => '/api/{apiVersion}/room/{token}/avatar', 'verb' => 'DELETE', 'requirements' => $requirements],
],

View file

@ -415,12 +415,3 @@
- Status code:
+ `200 OK`
+ `404 Not Found` When the conversation could not be found for the participant
* Required capability: `avatar`
* Method: `GET`
* Endpoint: `/room/{token}/avatar/dark`
* Response:
- Status code:
+ `200 OK`
+ `404 Not Found` When the conversation could not be found for the participant

View file

@ -98,8 +98,8 @@ class AvatarController extends AEnvironmentAwareController {
* @NoCSRFRequired
* @RequireParticipant
*/
public function getAvatar(bool $dark = false): Response {
$file = $this->avatarService->getAvatar($this->getRoom(), $this->userSession->getUser(), $dark);
public function getAvatar(): Response {
$file = $this->avatarService->getAvatar($this->getRoom(), $this->userSession->getUser());
$response = new FileDisplayResponse($file);
$response->addHeader('Content-Type', $file->getMimeType());
@ -108,14 +108,6 @@ class AvatarController extends AEnvironmentAwareController {
return $response;
}
/**
* @PublicPage
* @RequireParticipant
*/
public function getAvatarDark(): Response {
return $this->getAvatar(true);
}
/**
* @PublicPage
* @RequireModeratorParticipant

View file

@ -92,7 +92,7 @@ class AvatarService {
$this->cache->set($token . '.avatarVersion', md5($content));
}
public function getAvatar(Room $room, ?IUser $user, bool $dark = false): ISimpleFile {
public function getAvatar(Room $room, ?IUser $user): ISimpleFile {
$token = $room->getToken();
try {
$folder = $this->appData->getFolder('room-avatar');