diff --git a/app/src/main/kotlin/com/wire/android/mapper/SystemMessageContentMapper.kt b/app/src/main/kotlin/com/wire/android/mapper/SystemMessageContentMapper.kt index df0754c1fb0..abbd03a0561 100644 --- a/app/src/main/kotlin/com/wire/android/mapper/SystemMessageContentMapper.kt +++ b/app/src/main/kotlin/com/wire/android/mapper/SystemMessageContentMapper.kt @@ -221,8 +221,7 @@ class SystemMessageContentMapper @Inject constructor( UIMessageContent.SystemMessage.ConversationStartedWithMembers(memberNames = memberNameList) } - is FailedToAdd -> - UIMessageContent.SystemMessage.MemberFailedToAdd(mapFailedToAddUsersByDomain(content.members, userList)) + is FailedToAdd -> UIMessageContent.SystemMessage.MemberFailedToAdd(memberNameList) is MemberChange.FederationRemoved -> UIMessageContent.SystemMessage.FederationMemberRemoved( memberNames = memberNameList @@ -235,18 +234,6 @@ class SystemMessageContentMapper @Inject constructor( is MessageContent.FederationStopped.Removed -> UIMessageContent.SystemMessage.FederationStopped(listOf(content.domain)) } - private fun mapFailedToAddUsersByDomain(members: List, userList: List): Map> { - val memberNameList = members.groupBy { it.domain }.mapValues { - it.value.map { userId -> - mapMemberName( - user = userList.findUser(userId = userId), - type = SelfNameType.ResourceLowercase - ) - } - } - return memberNameList - } - private fun mapConversationHistoryLost(): UIMessageContent.SystemMessage = UIMessageContent.SystemMessage.HistoryLost() private fun mapMLSWrongEpochWarning(): UIMessageContent.SystemMessage = UIMessageContent.SystemMessage.MLSWrongEpochWarning() private fun mapConversationDegraded(protocol: Conversation.Protocol): UIMessageContent.SystemMessage = diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt index d685ad4f36a..d674819eb4c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt @@ -375,7 +375,7 @@ fun PreviewSystemMessageFailedToAddSingle() { SystemMessageItem( message = mockMessageWithKnock.copy( messageContent = SystemMessage.MemberFailedToAdd( - mapOf("wire.com" to listOf(UIText.DynamicString("Barbara Cotolina"))) + listOf(UIText.DynamicString("Barbara Cotolina")) ) ) ) @@ -389,11 +389,9 @@ fun PreviewSystemMessageFailedToAddMultiple() { SystemMessageItem( message = mockMessageWithKnock.copy( messageContent = SystemMessage.MemberFailedToAdd( - mapOf( - "wire.com" to listOf( - UIText.DynamicString("Barbara Cotolina"), - UIText.DynamicString("Albert Lewis") - ) + listOf( + UIText.DynamicString("Barbara Cotolina"), + UIText.DynamicString("Albert Lewis") ) ) ) @@ -612,18 +610,12 @@ private fun SystemMessage.MemberFailedToAdd.toFailedToAddAnnotatedText( if (expanded) { if (isMultipleUsersFailure) failedToAddAnnotatedText.append("\n") - memberNames.onEachIndexed { index, entry -> - failedToAddAnnotatedText.append( - res.annotatedText( - stringResId, normalStyle, boldStyle, normalColor, boldColor, errorColor, isErrorString, - *arrayOf( - entry.value.limitUserNamesList(res, entry.value.size).toUserNamesListString(res), - entry.key - ) - ) + failedToAddAnnotatedText.append( + res.annotatedText( + stringResId, normalStyle, boldStyle, normalColor, boldColor, errorColor, isErrorString, + memberNames.limitUserNamesList(res, usersCount).toUserNamesListString(res) ) - if (index < memberNames.size - 1) failedToAddAnnotatedText.append("\n") - } + ) } return failedToAddAnnotatedText.toAnnotatedString() } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt index 9e4b6842c42..b6d9571924d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt @@ -431,12 +431,12 @@ sealed class UIMessageContent { ) data class MemberFailedToAdd( - val memberNames: Map> + val memberNames: List ) : SystemMessage( R.drawable.ic_info, R.string.label_system_message_conversation_failed_add_members_details ) { - val usersCount = memberNames.values.flatten().size + val usersCount = memberNames.size } data class ConversationDegraded(val protocol: Conversation.Protocol) : SystemMessage( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1e40e25c3ae..5e04a750569 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -588,7 +588,7 @@ %1$s started the conversation With %1$s %1$s **participants** could not be added to the group. - %1$s could not be added to the group as the backend of %2$s could not be reached. + %1$s could not be added to the group. This conversation is no longer verified, as some user uses at least one device without a valid end-to-end identity certificate.