fix smth
This commit is contained in:
parent
86ad4689db
commit
0817bb43f0
|
|
@ -781,11 +781,14 @@ class Event extends MatrixEvent {
|
||||||
final canDownloadFileFromServer = uint8list == null && !fromLocalStoreOnly;
|
final canDownloadFileFromServer = uint8list == null && !fromLocalStoreOnly;
|
||||||
if (canDownloadFileFromServer) {
|
if (canDownloadFileFromServer) {
|
||||||
final httpClient = room.client.httpClient;
|
final httpClient = room.client.httpClient;
|
||||||
downloadCallback ??= (Uri url) async => (await httpClient.get(
|
downloadCallback ??= (Uri url) async {
|
||||||
url,
|
final res = await httpClient.get(
|
||||||
headers: {'authorization': 'Bearer ${room.client.accessToken}'},
|
url,
|
||||||
))
|
headers: {'authorization': 'Bearer ${room.client.accessToken}'},
|
||||||
.bodyBytes;
|
);
|
||||||
|
if (res.statusCode > 399) throw ('Bad status code');
|
||||||
|
return res.bodyBytes;
|
||||||
|
};
|
||||||
uint8list =
|
uint8list =
|
||||||
await downloadCallback(await mxcUrl.getDownloadUri(room.client));
|
await downloadCallback(await mxcUrl.getDownloadUri(room.client));
|
||||||
storeable = storeable && uint8list.lengthInBytes < database.maxFileSize;
|
storeable = storeable && uint8list.lengthInBytes < database.maxFileSize;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue