Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
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)
),
Expand Down Expand Up @@ -243,3 +243,14 @@
}
}
}

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

Check warning on line 252 in app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt#L252

Added line #L252 was not covered by tests
return otherUser.previewPicture
?.takeUnless { hidePicture }
?.let { UserAvatarAsset(it) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
Loading