Implement crude encrypted EventImage downloading

When a message image is clicked in an encrypted room, the full file will
be download (no GUI indication for now, just a print in terminal) and
opened when ready.

Before downloading, copying the image address via right click will put
the full image mxc:// URL in clipboard. After downloading, it will be
the local downloaded image path instead.
This commit is contained in:
miruka
2019-12-16 17:36:14 -04:00
parent 5dbf06ba6c
commit 1ec8ed466f
3 changed files with 43 additions and 15 deletions

View File

@@ -209,6 +209,8 @@ class Thumbnail(Media):
parsed = urlparse(self.mxc)
if self.crypt_dict:
# Matrix makes encrypted thumbs only available through the download
# end-point, not the thumbnail one
resp = await self.cache.backend.download(
server_name = parsed.netloc,
media_id = parsed.path.lstrip("/"),