mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 11:08:02 +00:00
Resolve names off Recipient objects in contact selection.
Fixes #3715 // FREEBIE
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package org.thoughtcrime.securesms.contacts;
|
package org.thoughtcrime.securesms.contacts;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
@@ -54,8 +55,13 @@ public class ContactSelectionListItem extends RelativeLayout implements Recipien
|
|||||||
if (type == ContactsDatabase.NEW_TYPE) {
|
if (type == ContactsDatabase.NEW_TYPE) {
|
||||||
this.recipients = null;
|
this.recipients = null;
|
||||||
this.contactPhotoImage.setAvatar(Recipient.getUnknownRecipient(), false);
|
this.contactPhotoImage.setAvatar(Recipient.getUnknownRecipient(), false);
|
||||||
} else if (number != null) {
|
} else if (!TextUtils.isEmpty(number)) {
|
||||||
this.recipients = RecipientFactory.getRecipientsFromString(getContext(), number, true);
|
this.recipients = RecipientFactory.getRecipientsFromString(getContext(), number, true);
|
||||||
|
|
||||||
|
if (this.recipients.getPrimaryRecipient().getName() != null) {
|
||||||
|
name = this.recipients.getPrimaryRecipient().getName();
|
||||||
|
}
|
||||||
|
|
||||||
this.recipients.addListener(this);
|
this.recipients.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +120,7 @@ public class ContactSelectionListItem extends RelativeLayout implements Recipien
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
contactPhotoImage.setAvatar(recipients, false);
|
contactPhotoImage.setAvatar(recipients, false);
|
||||||
|
nameView.setText(recipients.toShortString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user