diff --git a/mautrix_twitter/portal.py b/mautrix_twitter/portal.py index 5d2e624..034d3a0 100644 --- a/mautrix_twitter/portal.py +++ b/mautrix_twitter/portal.py @@ -353,8 +353,7 @@ async def _handle_matrix_message( mime_type = message.info.mimetype or magic.from_buffer(data, mime=True) upload_resp = await sender.client.upload(data, mime_type=mime_type) media_id = upload_resp.media_id - filename = message.get("filename", None) - if filename and filename != message.body: + if message.filename and message.filename != message.body: text = message.body else: text = "" @@ -511,11 +510,11 @@ async def _convert_twitter_message( if reply_to_msg: text_content.set_reply(reply_to_msg.mxid) if media_content and self.config["bridge.caption_in_message"]: - media_content["filename"] = media_content.body + media_content.filename = media_content.body media_content.body = text_content.body if text_content.formatted_body: - media_content["format"] = str(text_content.format) - media_content["formatted_body"] = text_content.formatted_body + media_content.format = text_content.format + media_content.formatted_body = text_content.formatted_body else: converted.append(text_content) return converted diff --git a/requirements.txt b/requirements.txt index f8c9439..fc30f1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ commonmark>=0.8,<0.10 aiohttp>=3,<4 yarl>=1,<2 attrs>=20.1 -mautrix>=0.20.2,<0.21 +mautrix>=0.20.5,<0.21 asyncpg>=0.20,<0.29 diff --git a/setup.py b/setup.py index 2b131e9..b3b3bd8 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ install_requires=install_requires, extras_require=extras_require, - python_requires="~=3.8", + python_requires="~=3.9", classifiers=[ "Development Status :: 4 - Beta", @@ -57,7 +57,6 @@ "Framework :: AsyncIO", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", ],