Skip to content

Commit 0137bfc

Browse files
committed
Update mautrix-python
1 parent f6cb26f commit 0137bfc

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

mautrix_telegram/portal.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -2336,20 +2336,17 @@ async def _handle_matrix_message(
23362336
sender.command_status = None
23372337
except (KeyError, TypeError):
23382338
if not logged_in or (
2339-
"filename" in content and content["filename"] != content.body
2339+
content.filename is not None and content.filename != content.body
23402340
):
2341-
if "filename" in content:
2342-
file_name = content["filename"]
2341+
if content.filename:
2342+
file_name = content.filename
23432343
caption_content = TextMessageEventContent(
23442344
msgtype=MessageType.TEXT,
23452345
body=content.body,
23462346
)
2347-
if (
2348-
"formatted_body" in content
2349-
and str(content.get("format")) == Format.HTML.value
2350-
):
2351-
caption_content["formatted_body"] = content["formatted_body"]
2352-
caption_content["format"] = Format.HTML
2347+
if content.formatted_body and content.format == Format.HTML:
2348+
caption_content.formatted_body = content.formatted_body
2349+
caption_content.format = Format.HTML
23532350
else:
23542351
caption_content = None
23552352
if caption_content:

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ python-magic>=0.4,<0.5
33
commonmark>=0.8,<0.10
44
aiohttp>=3,<4
55
yarl>=1,<2
6-
mautrix>=0.20.4,<0.21
6+
mautrix>=0.20.5,<0.21
77
tulir-telethon==1.35.0a1
88
asyncpg>=0.20,<0.30
99
mako>=1,<2

0 commit comments

Comments
 (0)