Improve unknown recipient handling in group sends.

Fixes #13980
This commit is contained in:
Greyson Parrelli
2025-02-14 12:17:19 -05:00
parent e1115255fb
commit 5595b79bf5
2 changed files with 5 additions and 2 deletions

View File

@@ -257,7 +257,7 @@ public final class GroupSendUtil {
{
Log.i(TAG, "Starting group send. GroupId: " + (groupId != null ? groupId.toString() : "none") + ", DistributionId: " + (distributionId != null ? distributionId.toString() : "none") + " RelatedMessageId: " + (relatedMessageId != null ? relatedMessageId.toString() : "none") + ", Targets: " + allTargets.size() + ", RecipientUpdate: " + isRecipientUpdate + ", Operation: " + sendOperation.getClass().getSimpleName());
Set<Recipient> unregisteredTargets = allTargets.stream().filter(Recipient::isUnregistered).collect(Collectors.toSet());
Set<Recipient> unregisteredTargets = allTargets.stream().filter(it -> it.isUnregistered() || it.isUnknown()).collect(Collectors.toSet());
List<Recipient> registeredTargets = allTargets.stream().filter(r -> !unregisteredTargets.contains(r)).collect(Collectors.toList());
RecipientData recipients = new RecipientData(context, registeredTargets, isStorySend);

View File

@@ -85,7 +85,7 @@ class Recipient(
private val callRingtoneUri: Uri? = null,
val expiresInSeconds: Int = 0,
val expireTimerVersion: Int = 1,
private val registeredValue: RegisteredState = RegisteredState.UNKNOWN,
private val registeredValue: RegisteredState = RegisteredState.NOT_REGISTERED,
val profileKey: ByteArray? = null,
val expiringProfileKeyCredential: ExpiringProfileKeyCredential? = null,
private val groupName: String? = null,
@@ -182,6 +182,9 @@ class Recipient(
/** Whether the recipient has been hidden from the contact list. */
val isHidden: Boolean = hiddenState != HiddenState.NOT_HIDDEN
/** Whether or not this is an unknown recipient. */
val isUnknown: Boolean = id.isUnknown
/** Whether the recipient represents an individual person (as opposed to a group or list). */
val isIndividual: Boolean
get() = !isGroup && !isCallLink && !isDistributionList && !isReleaseNotes