Skip to content

Refactor avatar handling.#52

Open
deleted-user-1 wants to merge 1 commit intoOpenRA:masterfrom
deleted-user-1:refactor-avatars
Open

Refactor avatar handling.#52
deleted-user-1 wants to merge 1 commit intoOpenRA:masterfrom
deleted-user-1:refactor-avatars

Conversation

@deleted-user-1
Copy link
Copy Markdown

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.

return $this->get_response("Error: No profile data");
}

$avatar = [
Copy link
Copy Markdown
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
Copy Markdown
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