Handle thumbnail urls

This commit is contained in:
Erik Johnston 2017-06-19 17:47:55 +01:00
parent b8b936a6ea
commit 385dcb7c60

View File

@ -562,18 +562,20 @@ 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")
if not url: thumbnail_url = content.get("info", {}).get("thumbnail_url")
continue
matches = mxc_re.match(url) for url in (content_url, thumbnail_url):
if matches: if not url:
hostname = matches.group(1) continue
media_id = matches.group(2) matches = mxc_re.match(url)
if hostname == self.hostname: if matches:
local_media_mxcs.append(media_id) hostname = matches.group(1)
else: media_id = matches.group(2)
remote_media_mxcs.append((hostname, media_id)) if hostname == self.hostname:
local_media_mxcs.append(media_id)
else:
remote_media_mxcs.append((hostname, media_id))
# Now update all the tables to set the quarantined_by flag # Now update all the tables to set the quarantined_by flag