From 28a6ffaf24063a36dcac611d82a2aaf2b88e3d53 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 28 Apr 2020 11:55:36 +0000 Subject: [PATCH] Make MAX_FILE_SIZE overrideable and reduce to 1mb --- lib/src/event.dart | 2 +- lib/src/store_api.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/event.dart b/lib/src/event.dart index 08bf2a8..924f64e 100644 --- a/lib/src/event.dart +++ b/lib/src/event.dart @@ -472,7 +472,7 @@ class Event { final storeable = room.client.storeAPI.extended && infoMap is Map && infoMap['size'] is int && - infoMap['size'] <= ExtendedStoreAPI.MAX_FILE_SIZE; + infoMap['size'] <= room.client.store.maxFileSize; if (storeable) { uint8list = await room.client.store.getFile(mxContent.toString()); diff --git a/lib/src/store_api.dart b/lib/src/store_api.dart index ded6c2f..dfe2ac8 100644 --- a/lib/src/store_api.dart +++ b/lib/src/store_api.dart @@ -62,7 +62,7 @@ abstract class StoreAPI { /// database. abstract class ExtendedStoreAPI extends StoreAPI { /// The maximum size of files which should be stored in bytes. - static const int MAX_FILE_SIZE = 10 * 1024 * 1024; + int get maxFileSize => 1 * 1024 * 1024; /// Whether this is a simple store which only stores the client credentials and /// end to end encryption stuff or the whole sync payloads.