fix issue with deleted accounts
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run

This commit is contained in:
otsmr 2026-04-05 16:31:25 +02:00
parent 955992d5d2
commit 337b9567c6
3 changed files with 12 additions and 1 deletions

View file

@ -5,6 +5,7 @@
- New: Developer settings to reduce flames
- Improve: Improved troubleshooting for issues with push notifications
- Fix: Flash not activated when starting a video recording
- Fix: Problem sending media when a recipient has deleted their account.
## 0.1.1

@ -1 +1 @@
Subproject commit 284c602b507e77addc8f21c4fc8a321f237cac1b
Subproject commit 425bdd58d02f718fbe5e6ed05e1a1e03aa181725

View file

@ -147,6 +147,16 @@ Future<void> insertMediaFileInMessagesTable(
),
);
for (final groupId in groupIds) {
final groupMembers = await twonlyDB.groupsDao.getGroupContact(groupId);
if (groupMembers.length == 1) {
if (groupMembers.first.accountDeleted) {
Log.warn(
'Did not send media file to $groupId because the only account has deleted his account.',
);
continue;
}
}
final message = await twonlyDB.messagesDao.insertMessage(
MessagesCompanion(
groupId: Value(groupId),