diff --git a/CHANGELOG.md b/CHANGELOG.md index a5243e7..63d5cdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/src/localization/translations b/lib/src/localization/translations index 284c602..425bdd5 160000 --- a/lib/src/localization/translations +++ b/lib/src/localization/translations @@ -1 +1 @@ -Subproject commit 284c602b507e77addc8f21c4fc8a321f237cac1b +Subproject commit 425bdd58d02f718fbe5e6ed05e1a1e03aa181725 diff --git a/lib/src/services/api/mediafiles/upload.service.dart b/lib/src/services/api/mediafiles/upload.service.dart index dadccdb..16f745e 100644 --- a/lib/src/services/api/mediafiles/upload.service.dart +++ b/lib/src/services/api/mediafiles/upload.service.dart @@ -147,6 +147,16 @@ Future 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),