Skip to content

Commit

Permalink
Update mautrix-python
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 9, 2024
1 parent 9487bf0 commit 234c5f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions mautrix_twitter/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
],
Expand Down

0 comments on commit 234c5f1

Please sign in to comment.