summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-01-19 18:29:39 +0000
committerRichard van der Hoff <richard@matrix.org>2018-01-19 18:29:39 +0000
commitad7ec63d08c9d814766ea4764e187bc7ba5589d7 (patch)
treed7c1b43df8b8e9387d72649b710b8591aac9f051 /synapse
parentFix bugs in block metrics (diff)
downloadsynapse-ad7ec63d08c9d814766ea4764e187bc7ba5589d7.tar.xz
Use the right path for url_preview thumbnails
This was introduced by #2627: we were overwriting the original media for url
previews with the thumbnails :/

(fixes https://github.com/vector-im/riot-web/issues/6012, hopefully)
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/media/v1/media_storage.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/media_storage.py b/synapse/rest/media/v1/media_storage.py
index 001e84578e..041ae396cd 100644
--- a/synapse/rest/media/v1/media_storage.py
+++ b/synapse/rest/media/v1/media_storage.py
@@ -164,6 +164,14 @@ class MediaStorage(object):
             str
         """
         if file_info.url_cache:
+            if file_info.thumbnail:
+                return self.filepaths.url_cache_thumbnail_rel(
+                    media_id=file_info.file_id,
+                    width=file_info.thumbnail_width,
+                    height=file_info.thumbnail_height,
+                    content_type=file_info.thumbnail_type,
+                    method=file_info.thumbnail_method,
+                )
             return self.filepaths.url_cache_filepath_rel(file_info.file_id)
 
         if file_info.server_name: