kopia lustrzana https://github.com/ryukoposting/Signal-Android
Ensure recipients added to the cache have an identifier.
rodzic
ab5d3badc2
commit
e47db0d532
|
@ -100,7 +100,7 @@ public final class LiveRecipientCache {
|
|||
*/
|
||||
@AnyThread
|
||||
public void addToCache(@NonNull Collection<Recipient> newRecipients) {
|
||||
for (Recipient recipient : newRecipients) {
|
||||
newRecipients.stream().filter(this::isValidForCache).forEach(recipient -> {
|
||||
LiveRecipient live;
|
||||
boolean needsResolve;
|
||||
|
||||
|
@ -131,7 +131,7 @@ public final class LiveRecipientCache {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull Recipient getSelf() {
|
||||
|
@ -205,4 +205,8 @@ public final class LiveRecipientCache {
|
|||
recipients.clear();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidForCache(@NonNull Recipient recipient) {
|
||||
return !recipient.getId().isUnknown() && (recipient.hasServiceIdentifier() || recipient.getGroupId().isPresent() || recipient.hasSmsAddress());
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue