Make MAX_FILE_SIZE overrideable and reduce to 1mb
This commit is contained in:
		
							parent
							
								
									b70ccd875d
								
							
						
					
					
						commit
						28a6ffaf24
					
				|  | @ -472,7 +472,7 @@ class Event { | ||||||
|     final storeable = room.client.storeAPI.extended && |     final storeable = room.client.storeAPI.extended && | ||||||
|         infoMap is Map<String, dynamic> && |         infoMap is Map<String, dynamic> && | ||||||
|         infoMap['size'] is int && |         infoMap['size'] is int && | ||||||
|         infoMap['size'] <= ExtendedStoreAPI.MAX_FILE_SIZE; |         infoMap['size'] <= room.client.store.maxFileSize; | ||||||
| 
 | 
 | ||||||
|     if (storeable) { |     if (storeable) { | ||||||
|       uint8list = await room.client.store.getFile(mxContent.toString()); |       uint8list = await room.client.store.getFile(mxContent.toString()); | ||||||
|  |  | ||||||
|  | @ -62,7 +62,7 @@ abstract class StoreAPI { | ||||||
| /// database. | /// database. | ||||||
| abstract class ExtendedStoreAPI extends StoreAPI { | abstract class ExtendedStoreAPI extends StoreAPI { | ||||||
|   /// The maximum size of files which should be stored in bytes. |   /// 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 |   /// Whether this is a simple store which only stores the client credentials and | ||||||
|   /// end to end encryption stuff or the whole sync payloads. |   /// end to end encryption stuff or the whole sync payloads. | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue