1414use OCP \AppFramework \Http \DataDisplayResponse ;
1515use OCP \AppFramework \Http \FileDisplayResponse ;
1616use OCP \AppFramework \Http \JSONResponse ;
17- use OCP \AppFramework \Http \RedirectResponse ;
17+ use OCP \AppFramework \Http \Response ;
1818use OCP \Files \File ;
1919use OCP \Files \IRootFolder ;
2020use OCP \IAvatarManager ;
2121use OCP \ICache ;
2222use OCP \IL10N ;
2323use OCP \IRequest ;
24- use OCP \IURLGenerator ;
2524use OCP \IUserManager ;
2625use Psr \Log \LoggerInterface ;
2726
@@ -42,7 +41,6 @@ public function __construct(
4241 protected LoggerInterface $ logger ,
4342 protected ?string $ userId ,
4443 protected TimeFactory $ timeFactory ,
45- protected IURLGenerator $ urlGenerator ,
4644 protected GuestAvatarController $ guestAvatarController ,
4745 ) {
4846 parent ::__construct ($ appName , $ request );
@@ -58,7 +56,8 @@ public function __construct(
5856 *
5957 * @param string $userId ID of the user
6058 * @param int $size Size of the avatar
61- * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string, X-NC-IsCustomAvatar: int}>|JSONResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>
59+ * @param bool $guestFallback Fallback to guest avatar if not found
60+ * @return FileDisplayResponse<Http::STATUS_OK|Http::STATUS_CREATED, array{Content-Type: string, X-NC-IsCustomAvatar?: int}>|JSONResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>|Response<Http::STATUS_INTERNAL_SERVER_ERROR, array{}>
6261 *
6362 * 200: Avatar returned
6463 * 404: Avatar not found
@@ -108,7 +107,8 @@ public function getAvatarDark(string $userId, int $size, bool $guestFallback = f
108107 *
109108 * @param string $userId ID of the user
110109 * @param int $size Size of the avatar
111- * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string, X-NC-IsCustomAvatar: int}>|JSONResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>
110+ * @param bool $guestFallback Fallback to guest avatar if not found
111+ * @return FileDisplayResponse<Http::STATUS_OK|Http::STATUS_CREATED, array{Content-Type: string, X-NC-IsCustomAvatar?: int}>|JSONResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>|Response<Http::STATUS_INTERNAL_SERVER_ERROR, array{}>
112112 *
113113 * 200: Avatar returned
114114 * 404: Avatar not found
0 commit comments