mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Improve cold start performance.
This commit is contained in:
@@ -52,8 +52,8 @@ public final class GroupsV1MigrationUtil {
|
||||
throw new InvalidMigrationStateException();
|
||||
}
|
||||
|
||||
if (groupRecipient.getParticipants().size() > FeatureFlags.groupLimits().getHardLimit()) {
|
||||
Log.w(TAG, "Too many members! Size: " + groupRecipient.getParticipants().size());
|
||||
if (groupRecipient.getParticipantIds().size() > FeatureFlags.groupLimits().getHardLimit()) {
|
||||
Log.w(TAG, "Too many members! Size: " + groupRecipient.getParticipantIds().size());
|
||||
throw new InvalidMigrationStateException();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class GroupsV1MigrationUtil {
|
||||
throw new InvalidMigrationStateException();
|
||||
}
|
||||
|
||||
List<Recipient> registeredMembers = RecipientUtil.getEligibleForSending(groupRecipient.getParticipants());
|
||||
List<Recipient> registeredMembers = RecipientUtil.getEligibleForSending(Recipient.resolvedList(groupRecipient.getParticipantIds()));
|
||||
|
||||
if (RecipientUtil.ensureUuidsAreAvailable(context, registeredMembers)) {
|
||||
Log.i(TAG, "Newly-discovered UUIDs. Getting fresh recipients.");
|
||||
|
||||
@@ -68,7 +68,8 @@ final class GroupsV1MigrationRepository {
|
||||
return new MigrationState(Collections.emptyList(), Collections.emptyList());
|
||||
}
|
||||
|
||||
Set<RecipientId> needsRefresh = Stream.of(group.getParticipants())
|
||||
List<Recipient> members = Recipient.resolvedList(group.getParticipantIds());
|
||||
Set<RecipientId> needsRefresh = Stream.of(members)
|
||||
.filter(r -> r.getGroupsV1MigrationCapability() != Recipient.Capability.SUPPORTED)
|
||||
.map(Recipient::getId)
|
||||
.collect(Collectors.toSet());
|
||||
@@ -82,7 +83,7 @@ final class GroupsV1MigrationRepository {
|
||||
}
|
||||
|
||||
try {
|
||||
List<Recipient> registered = Stream.of(group.getParticipants())
|
||||
List<Recipient> registered = Stream.of(members)
|
||||
.filter(Recipient::isRegistered)
|
||||
.toList();
|
||||
|
||||
@@ -93,13 +94,13 @@ final class GroupsV1MigrationRepository {
|
||||
|
||||
group = group.fresh();
|
||||
|
||||
List<Recipient> ineligible = Stream.of(group.getParticipants())
|
||||
List<Recipient> ineligible = Stream.of(members)
|
||||
.filter(r -> !r.hasServiceId() ||
|
||||
r.getGroupsV1MigrationCapability() != Recipient.Capability.SUPPORTED ||
|
||||
r.getRegistered() != RecipientDatabase.RegisteredState.REGISTERED)
|
||||
.toList();
|
||||
|
||||
List<Recipient> invites = Stream.of(group.getParticipants())
|
||||
List<Recipient> invites = Stream.of(members)
|
||||
.filterNot(ineligible::contains)
|
||||
.filterNot(Recipient::isSelf)
|
||||
.filter(r -> r.getProfileKey() == null)
|
||||
|
||||
Reference in New Issue
Block a user