From cc3919244b264cfb20c01aee50c302073f4d95ee Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Thu, 20 Nov 2025 11:18:44 -0400 Subject: [PATCH] Hide local user badge everywhere unless they have it enabled. --- .../thoughtcrime/securesms/recipients/Recipient.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/recipients/Recipient.kt b/app/src/main/java/org/thoughtcrime/securesms/recipients/Recipient.kt index c260b70c2c..bf739b3e47 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/recipients/Recipient.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/recipients/Recipient.kt @@ -370,8 +370,17 @@ class Recipient( } } - /** The badge to feature on a recipient's avatar, if any. */ - val featuredBadge: Badge? = badges.firstOrNull() + /** + * The badge to feature on a recipient's avatar, if any. + * This value respects the local user's [SignalStore.inAppPayments.getDisplayBadgesOnProfile()] preference. + */ + val featuredBadge: Badge? get() { + return if (isSelf && !SignalStore.inAppPayments.getDisplayBadgesOnProfile()) { + null + } else { + badges.firstOrNull() + } + } /** A string combining the about emoji + text for displaying various places. */ val combinedAboutAndEmoji: String? by lazy { listOf(aboutEmoji, about).filter { it.isNotNullOrBlank() }.joinToString(separator = " ").nullIfBlank() }