feat(User): Add getters for avatar URLs#60734
Open
provokateurin wants to merge 1 commit into
Open
Conversation
Signed-off-by: provokateurin <kate@provokateurin.de>
Member
Author
|
/backport to stable34 |
artonge
reviewed
May 26, 2026
|
|
||
| #[\Override] | ||
| public function getUserAvatarUrlLight(int $size): string { | ||
| $url = Server::get(IURLGenerator::class)->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $this->uid, 'size' => $size]); |
Collaborator
There was a problem hiding this comment.
Suggested change
| $url = Server::get(IURLGenerator::class)->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $this->uid, 'size' => $size]); | |
| $url = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $this->uid, 'size' => $size]); |
Same thing below.
Member
Author
It's used at least twice in Unified Sharing, so I didn't want to duplicate the logic and thought that this could be useful for others as well. |
come-nc
reviewed
May 26, 2026
Comment on lines
+213
to
+221
| #[\Override] | ||
| public function getUserAvatarUrlLight(int $size): string { | ||
| return $this->getUser()->getUserAvatarUrlLight($size); | ||
| } | ||
|
|
||
| #[\Override] | ||
| public function getUserAvatarUrlDark(int $size): string { | ||
| return $this->getUser()->getUserAvatarUrlDark($size); | ||
| } |
Contributor
There was a problem hiding this comment.
It’s a bit sad to resolve the user object while it’s not needed to build the URL.
I’m not entirely sure these methods have their place in IUser.
come-nc
reviewed
May 26, 2026
| public function setManagerUids(array $uids): void; | ||
|
|
||
| /** | ||
| * @param 64|512 $size |
Contributor
There was a problem hiding this comment.
Why only theses?
comments uses 42
user_status uses 44
Maybe there are doing it wrong but it should be justified if we need to change them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.