client: Simplify the thumbnail URL setting.

This commit is contained in:
Damir Jelić 2020-04-22 11:25:54 +02:00
parent 9e53315540
commit a2994b0a55

View File

@ -830,13 +830,10 @@ class PanClient(AsyncClient):
if isinstance(decrypted_event, RoomEncryptedMedia):
decrypted_event.source["content"]["url"] = decrypted_event.url
if (
"info" in decrypted_event.source
and "thumbnail_file" in decrypted_event.source["info"]
):
if decrypted_event.thumbnail_url:
decrypted_event.source["content"]["info"][
"thumbnail_url"
] = decrypted_event.source["thumbnail_file"].get("url")
] = decrypted_event.thumbnail_url
event_dict.update(decrypted_event.source)
event_dict["decrypted"] = True