mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Correctly load group avatars in RecipientPreferencesActivity
Fixes #7102 // FREEBIE
This commit is contained in:
parent
e87aa85bae
commit
7a8bd0597a
@ -216,9 +216,19 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
||||
Uri contentUri = ContactsContract.Contacts.lookupContact(getContentResolver(), recipient.getContactUri());
|
||||
windowManager.getDefaultDisplay().getMetrics(metrics);
|
||||
|
||||
return ContactPhotoFactory.getContactPhoto(RecipientPreferenceActivity.this, contentUri,
|
||||
recipient.getAddress(), recipient.getName(),
|
||||
metrics.widthPixels);
|
||||
if (recipient.isGroupRecipient()) {
|
||||
Optional<GroupDatabase.GroupRecord> groupRecord = DatabaseFactory.getGroupDatabase(RecipientPreferenceActivity.this).getGroup(recipient.getAddress().toGroupString());
|
||||
|
||||
if (groupRecord.isPresent() && groupRecord.get().getAvatar() != null) {
|
||||
return ContactPhotoFactory.getGroupContactPhoto(groupRecord.get().getAvatar());
|
||||
} else {
|
||||
return ContactPhotoFactory.getDefaultGroupPhoto();
|
||||
}
|
||||
} else {
|
||||
return ContactPhotoFactory.getContactPhoto(RecipientPreferenceActivity.this, contentUri,
|
||||
recipient.getAddress(), recipient.getName(),
|
||||
metrics.widthPixels);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onPostExecute(@NonNull ContactPhoto contactPhoto) {
|
||||
|
Loading…
Reference in New Issue
Block a user