matrix-spec-proposals icon indicating copy to clipboard operation
matrix-spec-proposals copied to clipboard

[WIP] MSC3868: Room Contribution

Open jae1911 opened this issue 3 years ago • 7 comments

Rendered

Signed-off-by: Aminda Suomalainen [email protected] Signed-off-by: Jae Lo Presti [email protected]

jae1911 avatar Aug 15 '22 20:08 jae1911

(converting this to a draft given TODO-style comments within the text)

Edit: or not, because for some reason it won't let me.

turt2live avatar Aug 15 '22 21:08 turt2live

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"

MayeulC avatar Aug 16 '22 15:08 MayeulC

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

jae1911 avatar Aug 16 '22 18:08 jae1911

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:
image image image
image image 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.

MayeulC avatar Aug 17 '22 08:08 MayeulC

Thanks for the input @MayeulC and what you said makes sense. Added it to the MSC!

jae1911 avatar Aug 17 '22 17:08 jae1911

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.

MayeulC avatar Aug 18 '22 11:08 MayeulC

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.

jae1911 avatar Aug 18 '22 16:08 jae1911