Don't cancel upload if server max size is unknown
This commit is contained in:
parent
2dbb155a22
commit
e2c6f0e64c
|
@ -1326,7 +1326,9 @@ class MatrixClient(nio.AsyncClient):
|
||||||
) -> UploadReturn:
|
) -> UploadReturn:
|
||||||
"""Upload a file to the matrix homeserver."""
|
"""Upload a file to the matrix homeserver."""
|
||||||
|
|
||||||
if filesize > self.models["accounts"][self.user_id].max_upload_size:
|
max_size = self.models["accounts"][self.user_id].max_upload_size
|
||||||
|
|
||||||
|
if max_size and filesize > max_size:
|
||||||
raise MatrixTooLarge()
|
raise MatrixTooLarge()
|
||||||
|
|
||||||
mime = mime or await utils.guess_mime(data_provider(0, 0))
|
mime = mime or await utils.guess_mime(data_provider(0, 0))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user