Update mautrix-python
This commit is contained in:
@@ -8,6 +8,8 @@ homeserver:
|
||||
# Only applies if address starts with https://
|
||||
verify_ssl: true
|
||||
asmux: false
|
||||
# Number of retries for all HTTP requests if the homeserver isn't reachable.
|
||||
http_retry_count: 4
|
||||
|
||||
# Application service host/registration related details
|
||||
# Changing these values requires regeneration of the registration.
|
||||
|
||||
@@ -30,7 +30,6 @@ from telethon.errors import (AuthBytesInvalidError, AuthKeyInvalidError, Locatio
|
||||
SecurityError, FileIdInvalidError)
|
||||
|
||||
from mautrix.appservice import IntentAPI
|
||||
from mautrix.util.network_retry import call_with_net_retry
|
||||
|
||||
from ..tgclient import MautrixTelegramClient
|
||||
from ..db import TelegramFile as DBTelegramFile
|
||||
@@ -145,8 +144,7 @@ async def transfer_thumbnail_to_matrix(client: MautrixTelegramClient, intent: In
|
||||
if encrypt:
|
||||
file, decryption_info = encrypt_attachment(file)
|
||||
upload_mime_type = "application/octet-stream"
|
||||
content_uri = await call_with_net_retry(intent.upload_media, file, upload_mime_type,
|
||||
_action="upload media")
|
||||
content_uri = await intent.upload_media(file, upload_mime_type)
|
||||
if decryption_info:
|
||||
decryption_info.url = content_uri
|
||||
|
||||
@@ -239,8 +237,7 @@ async def _unlocked_transfer_file_to_matrix(client: MautrixTelegramClient, inten
|
||||
if encrypt and encrypt_attachment:
|
||||
file, decryption_info = encrypt_attachment(file)
|
||||
upload_mime_type = "application/octet-stream"
|
||||
content_uri = await call_with_net_retry(intent.upload_media, file, upload_mime_type,
|
||||
_action="upload media")
|
||||
content_uri = await intent.upload_media(file, upload_mime_type)
|
||||
if decryption_info:
|
||||
decryption_info.url = content_uri
|
||||
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ python-magic>=0.4,<0.5
|
||||
commonmark>=0.8,<0.10
|
||||
aiohttp>=3,<4
|
||||
yarl>=1,<2
|
||||
mautrix>=0.8.11,<0.9
|
||||
mautrix>=0.9,<0.10
|
||||
telethon>=1.20,<1.22
|
||||
telethon-session-sqlalchemy>=0.2.14,<0.3
|
||||
|
||||
Reference in New Issue
Block a user