Merge branch 'ChristianPauly-master-patch-43099' into 'master'

Make MAX_FILE_SIZE overrideable and reduce to 1mb

See merge request famedly/famedlysdk!267
This commit is contained in:
Christian Pauly 2020-04-28 11:55:36 +00:00
commit 1265ebf7da
2 changed files with 2 additions and 2 deletions

View File

@ -472,7 +472,7 @@ class Event {
final storeable = room.client.storeAPI.extended &&
infoMap is Map<String, dynamic> &&
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());

View File

@ -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.