mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-02-02 18:44:50 -05:00
Remove return from MediaInfo.to_thumbnail()
and from MediaInfo.to_content()
This commit is contained in:
parent
7b4cc0527d
commit
5e81131ecf
@ -953,21 +953,21 @@ class ProxyDaemon:
|
|||||||
body=await response.transport_response.read(),
|
body=await response.transport_response.read(),
|
||||||
)
|
)
|
||||||
|
|
||||||
media_content = media_info.to_content(content, upload_info.mimetype)
|
media_info.to_content(content, upload_info.mimetype)
|
||||||
if media_content["info"].get("thumbnail_url", False):
|
if content["info"].get("thumbnail_url", False):
|
||||||
(
|
(
|
||||||
thumb_upload_info,
|
thumb_upload_info,
|
||||||
thumb_media_info,
|
thumb_media_info,
|
||||||
) = self._get_upload_and_media_info(
|
) = self._get_upload_and_media_info(
|
||||||
"thumbnail_url", media_content["info"]
|
"thumbnail_url", content["info"]
|
||||||
)
|
)
|
||||||
if thumb_upload_info and thumb_media_info:
|
if thumb_upload_info and thumb_media_info:
|
||||||
media_content = thumb_media_info.to_thumbnail(
|
thumb_media_info.to_thumbnail(
|
||||||
media_content, thumb_upload_info.mimetype
|
content, thumb_upload_info.mimetype
|
||||||
)
|
)
|
||||||
|
|
||||||
response = await client.room_send(
|
response = await client.room_send(
|
||||||
room_id, msgtype, media_content, txnid, ignore_unverified
|
room_id, msgtype, content, txnid, ignore_unverified
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
response = await client.room_send(
|
response = await client.room_send(
|
||||||
|
@ -58,7 +58,6 @@ class MediaInfo:
|
|||||||
"mimetype": mime_type,
|
"mimetype": mime_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
return content
|
|
||||||
|
|
||||||
def to_thumbnail(self, content: Dict, mime_type: str) -> Dict[Any, Any]:
|
def to_thumbnail(self, content: Dict, mime_type: str) -> Dict[Any, Any]:
|
||||||
content["info"]["thumbnail_file"] = {
|
content["info"]["thumbnail_file"] = {
|
||||||
@ -70,9 +69,6 @@ class MediaInfo:
|
|||||||
"mimetype": mime_type,
|
"mimetype": mime_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
return content
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@attr.s
|
@attr.s
|
||||||
class UploadInfo:
|
class UploadInfo:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user