From 6019f1bd5779212ee05f7d1e747529be0326c92e Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 22 May 2026 13:06:34 +0200 Subject: [PATCH] feat: hide incoming connection request picture --- .../com/wire/android/mapper/ConversationMapper.kt | 13 ++++++++++++- .../ui/userprofile/other/OtherUserProfileScreen.kt | 8 +++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt b/app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt index b46424ed272..04cc404f2b1 100644 --- a/app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt +++ b/app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt @@ -149,7 +149,7 @@ fun ConversationDetailsWithEvents.toConversationItem( is Connection -> { ConversationItem.ConnectionConversation( userAvatarData = UserAvatarData( - asset = conversationDetails.otherUser?.previewPicture?.let { UserAvatarAsset(it) }, + asset = previewPictureAsset(conversationDetails), availabilityStatus = conversationDetails.otherUser?.availabilityStatus ?: UserAvailabilityStatus.NONE, nameBasedAvatar = NameBasedAvatar(conversationDetails.otherUser?.name, conversationDetails.otherUser?.accentId ?: -1) ), @@ -243,3 +243,14 @@ private fun parseConversationEventType( } } } + +private const val WIRE_DOMAIN = "wire.com" + +private fun previewPictureAsset(connection: Connection): UserAvatarAsset? { + val otherUser = connection.otherUser ?: return null + val hidePicture = connection.connection.status == ConnectionState.PENDING && + otherUser.id.domain == WIRE_DOMAIN + return otherUser.previewPicture + ?.takeUnless { hidePicture } + ?.let { UserAvatarAsset(it) } +} diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt index 6575bfd5566..c3ed3e3e852 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt @@ -376,7 +376,11 @@ private fun TopBarCollapsing( UserProfileInfo( userId = targetState.userId, isLoading = targetState.isAvatarLoading, - avatarAsset = targetState.userAvatarAsset, + avatarAsset = targetState.userAvatarAsset + .takeUnless { + targetState.connectionState == ConnectionState.PENDING && + targetState.userId.domain == WIRE_DOMAIN + }, fullName = targetState.fullName, userName = targetState.userName, teamName = targetState.teamName, @@ -547,6 +551,8 @@ fun ContentFooter( } } +private const val WIRE_DOMAIN = "wire.com" + enum class OtherUserProfileTabItem(@StringRes val titleResId: Int) : TabItem { GROUP(R.string.user_profile_conversation_tab), DETAILS(R.string.user_profile_details_tab),