Show username in group invite flow.

This commit is contained in:
Cody Henthorne 2024-02-22 14:23:36 -05:00 committed by Greyson Parrelli
parent c04f761f5a
commit 763e891dfd
5 changed files with 6 additions and 6 deletions

View file

@ -1541,7 +1541,7 @@ final class GroupsV2UpdateMessageProducer {
String beforeChunk = template.substring(startIndex, nearestPosition);
builder.append(beforeChunk);
builder.append(SpanUtil.clickable(Recipient.resolved(recipientId).getDisplayName(context), ContextCompat.getColor(context, R.color.conversation_item_update_text_color), v -> {
builder.append(SpanUtil.clickable(Recipient.resolved(recipientId).getDisplayNameOrUsername(context), ContextCompat.getColor(context, R.color.conversation_item_update_text_color), v -> {
if (!recipientId.isUnknown() && clickHandler != null) {
clickHandler.accept(recipientId);
}

View file

@ -652,7 +652,7 @@ public class Recipient {
String name = Util.getFirstNonEmpty(getGroupName(context),
getSystemProfileName().getGivenName(),
getProfileName().getGivenName(),
getE164().orElse(null),
shouldShowE164() ? getE164().orElse(null) : null,
getUsername().orElse(null),
getDisplayName(context));

View file

@ -89,8 +89,8 @@ class AboutSheet : ComposeBottomSheetDialogFragment() {
model = AboutModel(
isSelf = recipient.get().isSelf,
hasAvatar = recipient.get().profileAvatarFileDetails.hasFile(),
displayName = recipient.get().getDisplayName(requireContext()),
shortName = recipient.get().getShortDisplayName(requireContext()),
displayName = recipient.get().getDisplayNameOrUsername(requireContext()),
shortName = recipient.get().getShortDisplayNameIncludingUsername(requireContext()),
about = recipient.get().about,
verified = verified,
recipientForAvatar = recipient.get(),

View file

@ -184,7 +184,7 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
}
String name = recipient.isSelf() ? requireContext().getString(R.string.note_to_self)
: recipient.getDisplayName(requireContext());
: recipient.getDisplayNameOrUsername(requireContext());
fullName.setVisibility(TextUtils.isEmpty(name) ? View.GONE : View.VISIBLE);
SpannableStringBuilder nameBuilder = new SpannableStringBuilder(name);
if (recipient.showVerified()) {

View file

@ -98,7 +98,7 @@ public final class GroupsV2UpdateMessageProducerTest {
private static Recipient recipientWithName(RecipientId id, String name) {
Recipient recipient = mock(Recipient.class);
when(recipient.getId()).thenReturn(id);
when(recipient.getDisplayName(any())).thenReturn(name);
when(recipient.getDisplayNameOrUsername(any())).thenReturn(name);
return recipient;
}