mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-07-05 11:54:45 -04:00
fix bug
This commit is contained in:
parent
83d1e12870
commit
a24f80c4d0
1 changed files with 3 additions and 2 deletions
|
@ -50,7 +50,6 @@ class MediaInfo:
|
||||||
|
|
||||||
def to_content(self, url: str, file_name: str, msgtype: str, mime_type: str) -> Dict[Any, Any]:
|
def to_content(self, url: str, file_name: str, msgtype: str, mime_type: str) -> Dict[Any, Any]:
|
||||||
content = {
|
content = {
|
||||||
"body": file_name,
|
|
||||||
"file": {
|
"file": {
|
||||||
"v": "v2",
|
"v": "v2",
|
||||||
"key": self.key,
|
"key": self.key,
|
||||||
|
@ -61,7 +60,9 @@ class MediaInfo:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(file_name) == 0:
|
if len(file_name) > 0:
|
||||||
|
content["body"] = file_name
|
||||||
|
else:
|
||||||
content["body"] = url
|
content["body"] = url
|
||||||
|
|
||||||
if msgtype:
|
if msgtype:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue