Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor avatar handling. #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deleted-user-1
Copy link

PhpBB's driver->get_data() method does not expose absolute URLs and
we need special handling for every avatar type due to each using a different URL pattern.
We therefore have to hardcode the avatar type name and path fragments and depend on
internals with which we will need to maintain compatibility in case of future upstream changes.
Using our own implementation with less overhead does not introduce further costs in this case.

I have tested this locally with all avatar types (gallery, file upload, upload from url, remote, gravatar) including customized image sizes and with legacy integer user_avatar_type.

Notes:

'core.get_gravatar_url_after' is an event only for customization and not used by phpBB internally, so we do not need this until we want to modify gravatars.

@@ -63,6 +63,12 @@ public function fetchinfo($type, $fingerprint)
return $this->get_response("Error: No profile data");
}

$avatar = [
Copy link
Author

@deleted-user-1 deleted-user-1 Jan 10, 2021

Choose a reason for hiding this comment

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

Defined here in preparation for #50 #53 .

PhpBB's driver->get_data() method does not expose absolute URLs and
we need special handling for every avatar type due to each using a different URL pattern.
We therefore have to hardcode the avatar type name and path fragments and depend on
internals with which we will need to maintain compatibility in case of future upstream changes.
Using our own implementation with less overhead does not introduce further costs in this case.
Copy link
Contributor

@dragunoff dragunoff left a comment

Choose a reason for hiding this comment

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

LGTM and works on my localhost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants