Skip to content

Conversation

@julien-nc
Copy link
Member

refs #2705

The r,g,b attributes are now private.

@julien-nc julien-nc added this to the Nextcloud 25 milestone Jul 11, 2022
@julien-nc
Copy link
Member Author

julien-nc commented Jul 11, 2022

I don't understand Psalm complaints...

@juliusknorr
Copy link
Member

Psalm uses the meta package to test against the OCP namespaces and this has not been updated yet: https://github.com/ChristophWurst/nextcloud_composer (should auto-resolve after the nightly bump)

$uniqueGuestId = !empty($guestName) ? $guestName : $this->secureRandom->generate(12);
$color = $this->avatarManager->getGuestAvatar($uniqueGuestId)->avatarBackgroundColor($uniqueGuestId);
return sprintf("#%02x%02x%02x", $color->r, $color->g, $color->b);
return sprintf("#%02x%02x%02x", $color->red(), $color->green(), $color->blue());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As now available with the new API:

Suggested change
return sprintf("#%02x%02x%02x", $color->red(), $color->green(), $color->blue());
return $color->name();

Copy link
Member Author

@julien-nc julien-nc Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@julien-nc julien-nc force-pushed the fix/2705/new-color-public-api branch from e4324a0 to 9d80897 Compare July 11, 2022 15:11
@julien-nc julien-nc requested a review from juliusknorr July 11, 2022 15:11
Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this locally and it fixed the color issue for me. I have no idea about the static analysis failure though.

@juliusknorr
Copy link
Member

Retriggered static analysis since ChristophWurst/nextcloud_composer@7367ca1 is there after the nightly auto update.

@juliusknorr juliusknorr merged commit 6134c33 into master Jul 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/2705/new-color-public-api branch July 12, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants