Do not show add to contacts if there's no e164.

This commit is contained in:
Greyson Parrelli
2024-02-02 15:59:49 -05:00
parent 700fe5e463
commit 47e55fc621
3 changed files with 3 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ sealed class ConversationSettingsViewModel(
contactLinkState = when {
recipient.isSelf || recipient.isReleaseNotes || recipient.isBlocked -> ContactLinkState.NONE
recipient.isSystemContact -> ContactLinkState.OPEN
recipient.hasE164() -> ContactLinkState.ADD
recipient.hasE164() && recipient.shouldShowE164() -> ContactLinkState.ADD
else -> ContactLinkState.NONE
}
)

View File

@@ -130,7 +130,7 @@ internal object ConversationOptionsMenu {
if (recipient.isMuted) menuInflater.inflate(R.menu.conversation_muted, menu) else menuInflater.inflate(R.menu.conversation_unmuted, menu)
if (!recipient.isGroup && (recipient.contactUri == null) && !recipient.isReleaseNotes && !recipient.isSelf && recipient.hasE164()) {
if (!recipient.isGroup && recipient.contactUri == null && !recipient.isReleaseNotes && !recipient.isSelf && recipient.hasE164() && recipient.shouldShowE164()) {
menuInflater.inflate(R.menu.conversation_add_to_contacts, menu)
}

View File

@@ -274,7 +274,7 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
buttonStrip.setVisibility(View.GONE);
}
if (recipient.isSystemContact() || recipient.isGroup() || recipient.isSelf() || recipient.isBlocked() || recipient.isReleaseNotes() || !recipient.hasE164()) {
if (recipient.isSystemContact() || recipient.isGroup() || recipient.isSelf() || recipient.isBlocked() || recipient.isReleaseNotes() || !recipient.hasE164() || !recipient.shouldShowE164()) {
addContactButton.setVisibility(View.GONE);
} else {
addContactButton.setVisibility(View.VISIBLE);