mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-13 03:53:39 +00:00
Fix problem with prefetched recipient details
Don't use a cached recipient if we have a prefetched recipient detail object and the cached recipient is still in progress and without a name // FREEBIE
This commit is contained in:
parent
79f8cf8e35
commit
efc4a5ab9d
@ -72,7 +72,8 @@ class RecipientProvider {
|
|||||||
|
|
||||||
@NonNull Recipient getRecipient(Context context, Address address, Optional<RecipientSettings> settings, Optional<GroupRecord> groupRecord, boolean asynchronous) {
|
@NonNull Recipient getRecipient(Context context, Address address, Optional<RecipientSettings> settings, Optional<GroupRecord> groupRecord, boolean asynchronous) {
|
||||||
Recipient cachedRecipient = recipientCache.get(address);
|
Recipient cachedRecipient = recipientCache.get(address);
|
||||||
if (cachedRecipient != null && !cachedRecipient.isStale() && (asynchronous || !cachedRecipient.isResolving())) {
|
|
||||||
|
if (cachedRecipient != null && !cachedRecipient.isStale() && (asynchronous || !cachedRecipient.isResolving()) && ((!groupRecord.isPresent() && !settings.isPresent()) || !cachedRecipient.isResolving() || cachedRecipient.getName() != null)) {
|
||||||
return cachedRecipient;
|
return cachedRecipient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user