some typos

This commit is contained in:
otsmr 2025-07-11 13:51:36 +02:00
parent c7c168176d
commit 877ee9a057
2 changed files with 7 additions and 5 deletions

View file

@ -46,7 +46,7 @@ void main() async {
await twonlyDB.messagesDao.handleMediaFilesOlderThan7Days(); await twonlyDB.messagesDao.handleMediaFilesOlderThan7Days();
await twonlyDB.signalDao.purgeOutDatedPreKeys(); await twonlyDB.signalDao.purgeOutDatedPreKeys();
// purge media files in the background // Purge media files in the background
purgeReceivedMediaFiles(); purgeReceivedMediaFiles();
purgeSendMediaFiles(); purgeSendMediaFiles();

View file

@ -20,7 +20,7 @@ import 'package:twonly/src/views/camera/share_image_editor_view.dart';
Map<int, DateTime> downloadStartedForMediaReceived = {}; Map<int, DateTime> downloadStartedForMediaReceived = {};
Future tryDownloadAllMediaFiles({bool force = false}) async { Future tryDownloadAllMediaFiles({bool force = false}) async {
// this is called when websocket is newly connected, so allow all downloads to be restarted. // This is called when WebSocket is newly connected, so allow all downloads to be restarted.
downloadStartedForMediaReceived = {}; downloadStartedForMediaReceived = {};
List<Message> messages = List<Message> messages =
await twonlyDB.messagesDao.getAllMessagesPendingDownloading(); await twonlyDB.messagesDao.getAllMessagesPendingDownloading();
@ -378,17 +378,19 @@ Future<void> purgeMediaFiles(Directory directory) async {
} }
} }
if (message.acknowledgeByServer) { if (message.acknowledgeByServer) {
// preserve images which can be stored by the other person... // Preserve images which can be stored by the other person...
if (content.maxShowTime != gMediaShowInfinite) { if (content.maxShowTime != gMediaShowInfinite) {
canBeDeleted = true; canBeDeleted = true;
} }
// encrypted or upload data can be removed when acknowledgedByServer // Encrypted or upload data can be removed when acknowledgeByServer
if (file.path.contains(".upload") || if (file.path.contains(".upload") ||
file.path.contains(".encrypted")) { file.path.contains(".encrypted")) {
canBeDeleted = true; canBeDeleted = true;
} }
} }
} catch (e) {} } catch (e) {
Log.error(e);
}
} }
if (canBeDeleted) { if (canBeDeleted) {
Log.info("purged media file ${file.path} "); Log.info("purged media file ${file.path} ");