mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Fetch newly found profiles on Groups V2 inline.
This commit is contained in:
committed by
Greyson Parrelli
parent
12533d1414
commit
8cb9ab3204
@@ -286,8 +286,9 @@ public final class GroupDatabase extends Database {
|
||||
List<Recipient> recipients = new ArrayList<>(currentMembers.size());
|
||||
|
||||
for (RecipientId member : currentMembers) {
|
||||
if (memberSet.includeSelf || !Recipient.resolved(member).isLocalNumber()) {
|
||||
recipients.add(Recipient.resolved(member));
|
||||
Recipient resolved = Recipient.resolved(member);
|
||||
if (memberSet.includeSelf || !resolved.isLocalNumber()) {
|
||||
recipients.add(resolved);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -817,9 +818,7 @@ public final class GroupDatabase extends Database {
|
||||
}
|
||||
|
||||
public List<Recipient> getMemberRecipients(@NonNull MemberSet memberSet) {
|
||||
return Stream.of(getMemberRecipientIds(memberSet))
|
||||
.map(Recipient::resolved)
|
||||
.toList();
|
||||
return Recipient.resolvedList(getMemberRecipientIds(memberSet));
|
||||
}
|
||||
|
||||
public List<RecipientId> getMemberRecipientIds(@NonNull MemberSet memberSet) {
|
||||
|
||||
@@ -1391,13 +1391,13 @@ public class RecipientDatabase extends Database {
|
||||
* If from authoritative source, this will overwrite local, otherwise it will only write to the
|
||||
* database if missing.
|
||||
*/
|
||||
public Collection<RecipientId> persistProfileKeySet(@NonNull ProfileKeySet profileKeySet) {
|
||||
public Set<RecipientId> persistProfileKeySet(@NonNull ProfileKeySet profileKeySet) {
|
||||
Map<UUID, ProfileKey> profileKeys = profileKeySet.getProfileKeys();
|
||||
Map<UUID, ProfileKey> authoritativeProfileKeys = profileKeySet.getAuthoritativeProfileKeys();
|
||||
int totalKeys = profileKeys.size() + authoritativeProfileKeys.size();
|
||||
|
||||
if (totalKeys == 0) {
|
||||
return Collections.emptyList();
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
Log.i(TAG, String.format(Locale.US, "Persisting %d Profile keys, %d of which are authoritative", totalKeys, authoritativeProfileKeys.size()));
|
||||
|
||||
Reference in New Issue
Block a user