Skip to content

Commit

Permalink
Fix issue where group count flashes in contact selection item.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed Aug 5, 2021
1 parent 4919012 commit 164f39e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,14 @@ public void onRecipientChanged(@NonNull Recipient recipient) {
if (this.recipient != null && this.recipient.getId().equals(recipient.getId())) {
contactName = recipient.getDisplayName(getContext());
contactAbout = recipient.getCombinedAboutAndEmoji();
contactNumber = PhoneNumberFormatter.prettyPrint(recipient.getE164().or(""));

if (recipient.isGroup() && recipient.getGroupId().isPresent()) {
contactNumber = recipient.getGroupId().get().toString();
} else if (recipient.hasE164()) {
contactNumber = PhoneNumberFormatter.prettyPrint(recipient.getE164().or(""));
} else {
contactNumber = recipient.getEmail().or("");
}

contactPhotoImage.setAvatar(glideRequests, recipient, false);
setText(recipient, contactType, contactName, contactNumber, contactLabel, contactAbout);
Expand Down

0 comments on commit 164f39e

Please sign in to comment.