Force Discord avatars to be PNGs in a friendly matter #792
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.
This can be considered a hack in order to fix #788
It was discussed a bit in
#help:t2bot.ioon what the root cause of the issue might be, and it was found out that the bridge creates webp thumbnails for users on t2bot.io, which then often (not always for some reason) aren't mirrored to matrix.org (and potentially other HS), causing Clients to just display a default/broken avatar.This PR circumvents the root cause, by just forcing all avatars to be in PNG format, as then thumbnails get mirrored correctly.
Only users who update their avatar will create revalidation. This is done in order to not revalidate every user currently existing on the bridge which would cause quite a bit of network traffic.
An alternative solution would be to implement #743; have a config file with a wished image file format, which is then used for checking the discord profile picture. I however am not that proficient with JS nor can I self-host/test my changes, hence this primitive solution.
Even better would be to figure out why the thumbnails aren't generates/mirrored in the first place. Possibly is related to #770, but not sure.
Either way, I'm opening this PR so that people who are self-hosting and are encountering the issue have a solution they can apply until the underlying root causes can be found and properly fixed.