matrix-spec-proposals
                                
                                 matrix-spec-proposals copied to clipboard
                                
                                    matrix-spec-proposals copied to clipboard
                            
                            
                            
                        [WIP] MSC3868: Room Contribution
(converting this to a draft given TODO-style comments within the text)
Edit: or not, because for some reason it won't let me.
A lot of GitHub projects display badges. It might be interesting to allow images as well as urls, possibly with an extra key: "badge-url" : "mxc://something"
A lot of GitHub projects display badges. It might be interesting to allow images as well as urls, possibly with an extra key:
"badge-url" : "mxc://something"
I find that to be a good idea, however, after a discussion with @Mikaela we are a bit concerned over some points:
- Media repos, as of now (and at least the default one for Synapse), tends to conserve medias forever, even when events are deleted (https://github.com/matrix-org/synapse/issues/1263)
- If a regular URI to a badge/image is used, the image would have to be proxied by the media repo to avoid the user loading the image directly and maybe leaking IP addresses and that would add complexity to the implementation of this MSC
To be clearer:
- I think a regular URI should not be identified, only mxc content
- I did not initially think of "dynamic" badges, mostly something like these instead:
|  |  |  | 
|---|---|---|
|  |  | etc | 
You are right though, it would be tempting to upload a lot of images for dynamic badges. It would be simpler if mxc links were content-based #3468, as that would de-duplicate them.
For cleanup, there is still the admin API: https://matrix-org.github.io/synapse/latest/admin_api/media_admin_api.html#delete-local-media-by-date-or-size and purge remote media. Those files should be relatively small, but I don't really see a solution short of allowing a background-image and formatted_body, which sounds relatively complex to implement.
Thanks for the input @MayeulC and what you said makes sense. Added it to the MSC!
Looks good! Maybe advise against uploading new content too frequently? I am not entirely sure about images:
- maybe base64 encoding would be better?
- is it necessary to specify width/height limits? Or is it implied that clients will only likely draw them with small dimensions, therefore it is advised to use images that work well at small size? Usually with such images, aspect ratio is the issue, as images have a max height of ~1em and no real max width (though in practice they do).
I assume people will just pick something that looks good on their client.
I assume as well that clients will format it the best it looks for them and will probably fix height and width limits on their own.
I'm gonna look into base64 but I think the MXC URIs are solid and the most practical choice for now.