SpringAll
SpringAll copied to clipboard
Supply actually raw photo in avatar's JSON
With https://github.com/diaspora/diaspora/pull/8100, I introduced a workaround to make JSON spec validation pass by providing the scaled_full version of a profile photo as the raw version as well: https://github.com/diaspora/diaspora/blob/04d0d6dccbee786a1e2b941d00ed8087fbf3c3f7/app/presenters/avatar_presenter.rb#L28-L31
This should be replaced by providing the real raw photo.
So, this is painful. More painful than it should be. Summary:
Unlike with all other photos, we don't store profile pictures as actual photos. They don't pass the usual methods, and we don't have the flexibility that we have with regular Photos. image_url, image_url_medium, and image_url_small are stored as their path values directly inside the database. These fields also get federated that way. Therefore, adding a raw photo with our current infrastructure would mean:
- Adding a new column to the
profilestable, which I'm not really keen on. - Adjusting the federation layer to now require a
image_url_rawas well. - Use the new raw URL, with some kind of fallback for older diaspora versions (and surprise packages like Friendica)
and all of that is a bit bonkers. That's the approach I initially started, but realistically, that's building a hack upon another hack. What we should do instead:
- Drop everything related to avatars we have right now.
- Replace them with references to actual
Photos. - Federate them as such, i.e. have a profile federate an inline
Photoas the profile image.
And then we'd end up in a place where we don't shoot ourselves in the foot every second month. However, that would mean even more work initially, and probably more complicated fallbacks for older versions. :(
I'll open a thread on Discourse so we have a chance to figure this out.
=> https://discourse.diasporafoundation.org/t/3011