From a870ef003030331ad410685405ed0a80b9b046a5 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Fri, 4 Sep 2020 15:52:24 -0400 Subject: [PATCH] Set isRecipientUpdate based on delivery status, not address count. We were setting isRecipientUpdate to `true` incorrectly if there were unregistered people in the group, resulting in the message not being rendered on linked devices. Instead of using the address count, we can just look at the current receipt status of the message. Fixes #9981 --- .../org/thoughtcrime/securesms/jobs/PushGroupSendJob.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java b/app/src/main/java/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java index 0d4f2789d..7eee96ab7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java @@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.attachments.Attachment; import org.thoughtcrime.securesms.crypto.UnidentifiedAccessUtil; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.GroupDatabase; +import org.thoughtcrime.securesms.database.GroupReceiptDatabase; import org.thoughtcrime.securesms.database.GroupReceiptDatabase.GroupReceiptInfo; import org.thoughtcrime.securesms.database.MessageDatabase; import org.thoughtcrime.securesms.database.MmsDatabase; @@ -299,7 +300,8 @@ public final class PushGroupSendJob extends PushSendJob { List addresses = RecipientUtil.toSignalServiceAddressesFromResolved(context, destinations); List attachments = Stream.of(message.getAttachments()).filterNot(Attachment::isSticker).toList(); List attachmentPointers = getAttachmentPointersFor(attachments); - boolean isRecipientUpdate = destinations.size() != DatabaseFactory.getGroupReceiptDatabase(context).getGroupReceiptInfo(messageId).size(); + boolean isRecipientUpdate = Stream.of(DatabaseFactory.getGroupReceiptDatabase(context).getGroupReceiptInfo(messageId)) + .anyMatch(info -> info.getStatus() > GroupReceiptDatabase.STATUS_UNDELIVERED); List> unidentifiedAccess = Stream.of(destinations) .map(recipient -> UnidentifiedAccessUtil.getAccessFor(context, recipient))