mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-30 16:29:30 +01:00
Merge branch 'soru/fix-thumbnails' into 'main'
fix: Database does not store files correctly Closes #450 See merge request famedly/fluffychat!428
This commit is contained in:
commit
3bb257a907
@ -50,7 +50,7 @@ class FlutterFamedlySdkHiveDatabase extends FamedlySdkHiveDatabase {
|
||||
} on MissingPluginException catch (_) {
|
||||
Logs().i('Hive encryption is not supported on this platform');
|
||||
}
|
||||
final db = FamedlySdkHiveDatabase(
|
||||
final db = FlutterFamedlySdkHiveDatabase(
|
||||
client.clientName,
|
||||
encryptionCipher: hiverCipher,
|
||||
);
|
||||
@ -78,7 +78,7 @@ class FlutterFamedlySdkHiveDatabase extends FamedlySdkHiveDatabase {
|
||||
Future<Uint8List> getFile(String mxcUri) async {
|
||||
if (!supportsFileStoring) return null;
|
||||
final tempDirectory = await _getFileStoreDirectory();
|
||||
final file = File('$tempDirectory/$mxcUri');
|
||||
final file = File('$tempDirectory/${Uri.encodeComponent(mxcUri)}');
|
||||
if (await file.exists() == false) return null;
|
||||
final bytes = await file.readAsBytes();
|
||||
return bytes;
|
||||
@ -88,7 +88,7 @@ class FlutterFamedlySdkHiveDatabase extends FamedlySdkHiveDatabase {
|
||||
Future storeFile(String mxcUri, Uint8List bytes, int time) async {
|
||||
if (!supportsFileStoring) return null;
|
||||
final tempDirectory = await _getFileStoreDirectory();
|
||||
final file = File('$tempDirectory/$mxcUri');
|
||||
final file = File('$tempDirectory/${Uri.encodeComponent(mxcUri)}');
|
||||
if (await file.exists()) return;
|
||||
await file.writeAsBytes(bytes);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user