element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.26k stars 2.01k forks source link

Make links to external instance versions of images accessible #13841

Open Soundtoxin opened 4 years ago

Soundtoxin commented 4 years ago

Is your suggestion related to a problem? Please describe. I am primarily using chat.weho.st is my matrix instance. The file size limit is 10MB. Many of my friends are on matrix.org which has either no limit or a really big one. Sometimes they post a picture (often from a high quality camera) that is over 10MB. On my end the image never shows up, I can't access it, if I click the download link it shows me a file-size error in another tab. However, the link to the matrix.org version of the image is public. I just can't see it myself. I have another account on matrix.org. If I log in there and see the image, I can copy/paste the link and then open it from the other side. I also confirmed it doesn't just work because I'm signed into matrix.org as well by opening it with mpv+youtube-dl, demonstrating authentication is not needed. Basically, I want to know why I can't just access that link from my weho.st account directly. Why do I get a different link if it's just not going to work anyway? FYI I am using Riot in a web browser for both instances.

Describe the solution you'd like A good example of this sort of thing being implemented is on the activitypub-based fediverse. I see local versions of posts and images, but I can also hit a button to view the version from the source instance, so there is a precedent for something like this.

Describe alternatives you've considered Either a config option to set links to go to the instance they were posted from, or maybe something more specific like falling back to them in cases like this where the local version doesn't work.

Additional context https://chat.weho.st/_matrix/media/r0/download/matrix.org/gbVznlYjOOfEupMmKduusCYX 2020-04-22-232719_grim https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/gbVznlYjOOfEupMmKduusCYX 2020-04-22-232747_grim

(originally filed this under https://github.com/matrix-org/synapse/issues/7329 and was told to re-make it here, I put off doing so for a while)

t3chguy commented 4 years ago

There is no reliable way to find another server's homeserver URL. The homeserver may expose its delegation via .well-known but this is not a requirement (except for federation endpoints). Additionally you should not be connecting directly to other homeservers due to the privacy leak there. If anything it should be a spec issue to allow homeservers to proxy this request through to the origin server.