mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-26 11:36:03 +03:00
Handle thumbnail urls
This commit is contained in:
parent
b8b936a6ea
commit
385dcb7c60
1 changed files with 13 additions and 11 deletions
|
@ -562,10 +562,12 @@ class RoomStore(SQLBaseStore):
|
||||||
next_token = stream_ordering
|
next_token = stream_ordering
|
||||||
content = json.loads(content_json)
|
content = json.loads(content_json)
|
||||||
|
|
||||||
url = content.get("url")
|
content_url = content.get("url")
|
||||||
|
thumbnail_url = content.get("info", {}).get("thumbnail_url")
|
||||||
|
|
||||||
|
for url in (content_url, thumbnail_url):
|
||||||
if not url:
|
if not url:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
matches = mxc_re.match(url)
|
matches = mxc_re.match(url)
|
||||||
if matches:
|
if matches:
|
||||||
hostname = matches.group(1)
|
hostname = matches.group(1)
|
||||||
|
|
Loading…
Reference in a new issue