use mxc data in send_message

This commit is contained in:
Andrea Spacca 2020-12-22 02:47:28 +01:00
parent e5922da6ec
commit 5273b83574

View File

@ -19,6 +19,7 @@ import urllib.parse
import concurrent.futures import concurrent.futures
from json import JSONDecodeError from json import JSONDecodeError
from typing import Any, Dict from typing import Any, Dict
from urllib.parse import urlparse
from uuid import uuid4 from uuid import uuid4
import aiohttp import aiohttp
@ -862,8 +863,9 @@ class ProxyDaemon:
if upload is None: if upload is None:
return await self.forward_to_web(request, token=client.access_token) return await self.forward_to_web(request, token=client.access_token)
server_name = request.match_info["server_name"] mxc = urlparse(content_uri)
media_id = content_uri server_name = mxc.netloc.strip("/")
media_id = mxc.path.strip("/")
file_name = request.match_info.get("file_name") file_name = request.match_info.get("file_name")
response, decrypted_file, error = self._load_media(server_name, media_id, file_name, request) response, decrypted_file, error = self._load_media(server_name, media_id, file_name, request)