Skip to content
Merged
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 @@ -658,6 +658,7 @@ fun ConversationScreen(
currentTimeInMillisFlow = conversationMessagesViewModel.currentTimeInMillisFlow,
onAttachmentClick = messageAttachmentsViewModel::onAttachmentClicked,
onAttachmentMenuClick = messageAttachmentsViewModel::onAttachmentMenuClicked,
isWireCellsEnabled = conversationInfoViewModel.conversationInfoViewState.isWireCellEnabled,
)
BackHandler { conversationScreenOnBackButtonClick(messageComposerViewModel, messageComposerStateHolder, navigator) }
DeleteMessageDialog(
Expand Down Expand Up @@ -913,6 +914,7 @@ private fun ConversationScreen(
onAttachmentClick: (AttachmentDraftUi) -> Unit,
onAttachmentMenuClick: (AttachmentDraftUi) -> Unit,
currentTimeInMillisFlow: Flow<Long> = flow { },
isWireCellsEnabled: Boolean = false,
) {
val context = LocalContext.current
val snackbarHostState = LocalSnackbarHostState.current
Expand Down Expand Up @@ -1011,6 +1013,7 @@ private fun ConversationScreen(
onAttachmentMenuClick = onAttachmentMenuClick,
showHistoryLoadingIndicator = conversationInfoViewState.showHistoryLoadingIndicator,
isBubbleUiEnabled = conversationInfoViewState.isBubbleUiEnabled,
isWireCellsEnabled = isWireCellsEnabled,
)
}
}
Expand Down Expand Up @@ -1094,7 +1097,8 @@ private fun ConversationScreenContent(
onAttachmentMenuClick: (AttachmentDraftUi) -> Unit,
currentTimeInMillisFlow: Flow<Long> = flow {},
showHistoryLoadingIndicator: Boolean = false,
isBubbleUiEnabled: Boolean = false
isBubbleUiEnabled: Boolean = false,
isWireCellsEnabled: Boolean = false,
) {
val lazyPagingMessages = messages.collectAsLazyPagingItems()

Expand Down Expand Up @@ -1140,6 +1144,7 @@ private fun ConversationScreenContent(
currentTimeInMillisFlow = currentTimeInMillisFlow,
showHistoryLoadingIndicator = showHistoryLoadingIndicator,
isBubbleUiEnabled = isBubbleUiEnabled,
isWireCellsEnabled = isWireCellsEnabled,
)
},
onChangeSelfDeletionClicked = onChangeSelfDeletionClicked,
Expand Down Expand Up @@ -1220,7 +1225,8 @@ fun MessageList(
modifier: Modifier = Modifier,
currentTimeInMillisFlow: Flow<Long> = flow { },
showHistoryLoadingIndicator: Boolean = false,
isBubbleUiEnabled: Boolean = false
isBubbleUiEnabled: Boolean = false,
isWireCellsEnabled: Boolean = false,
) {
val prevItemCount = remember { mutableStateOf(lazyPagingMessages.itemCount) }
val readLastMessageAtStartTriggered = remember { mutableStateOf(false) }
Expand Down Expand Up @@ -1347,7 +1353,8 @@ fun MessageList(
onSelfDeletingMessageRead = onSelfDeletingMessageRead,
isSelectedMessage = (message.header.messageId == selectedMessageId),
failureInteractionAvailable = interactionAvailability == InteractionAvailability.ENABLED,
isBubbleUiEnabled = isBubbleUiEnabled
isBubbleUiEnabled = isBubbleUiEnabled,
isWireCellsEnabled = isWireCellsEnabled,
)

val isTheOnlyItem = index == 0 && lazyPagingMessages.itemCount == 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ fun MessageContainerItem(
isSelectedMessage: Boolean = false,
failureInteractionAvailable: Boolean = true,
defaultBackgroundColor: Color = colorsScheme().surfaceContainerLow,
isBubbleUiEnabled: Boolean = false
isBubbleUiEnabled: Boolean = false,
isWireCellsEnabled: Boolean = false,
) {
val selfDeletionTimerState = rememberSelfDeletionTimer(message.header.messageStatus.expirationStatus)
if (
Expand Down Expand Up @@ -76,6 +77,7 @@ fun MessageContainerItem(
when (message) {
is UIMessage.System -> SystemMessageItem(
message = message,
isWireCellsEnabled = isWireCellsEnabled,
onFailedMessageCancelClicked = clickActions.onFailedMessageCancelClicked,
onFailedMessageRetryClicked = clickActions.onFailedMessageRetryClicked,
failureInteractionAvailable = failureInteractionAvailable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ fun SystemMessageItem(
message: UIMessage.System,
modifier: Modifier = Modifier,
initiallyExpanded: Boolean = false,
isWireCellsEnabled: Boolean = false,
failureInteractionAvailable: Boolean = true,
onFailedMessageRetryClicked: (String, ConversationId) -> Unit = { _, _ -> },
onFailedMessageCancelClicked: (String) -> Unit = {},
) = with(message.messageContent.buildContent()) {
) = with(message.messageContent.buildContent(isWireCellsEnabled)) {
val textStyle = MaterialTheme.wireTypography.body01
val lineHeightDp: Dp = with(LocalDensity.current) { textStyle.lineHeight.toDp() }
MessageItemTemplate(
Expand Down Expand Up @@ -148,7 +149,7 @@ fun SystemMessageItem(

@Suppress("LongParameterList", "SpreadOperator", "ComplexMethod", "LongMethod")
@Composable
private fun SystemMessage.buildContent() = when (this) {
private fun SystemMessage.buildContent(isWireCellsEnabled: Boolean) = when (this) {
is SystemMessage.MemberAdded -> buildContent(
iconResId = R.drawable.ic_add,
iconTintColor = MaterialTheme.wireColorScheme.onBackground,
Expand Down Expand Up @@ -514,8 +515,16 @@ private fun SystemMessage.buildContent() = when (this) {
normalColor = MaterialTheme.wireColorScheme.onSurface,
boldColor = MaterialTheme.wireColorScheme.onPositiveVariant
)
val header = stringResource(R.string.label_system_message_conversation_started_sensitive_information_header)
val message = stringResource(R.string.label_system_message_conversation_started_sensitive_information_message)
val header = if (isWireCellsEnabled) {
stringResource(R.string.label_system_message_conversation_started_sensitive_information_header_with_cells_on)
} else {
stringResource(R.string.label_system_message_conversation_started_sensitive_information_header)
}
val message = if (isWireCellsEnabled) {
stringResource(R.string.label_system_message_conversation_started_sensitive_information_message_with_cells_on)
} else {
stringResource(R.string.label_system_message_conversation_started_sensitive_information_message)
}
val footer = stringResource(R.string.label_system_message_conversation_started_sensitive_information_footer)
buildAnnotatedString {
append(header.toMarkdownAnnotatedString(markdownTextStyle))
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,9 @@
<string name="label_system_message_conversation_verified_mls">All devices are verified (end-to-end identity)</string>
<string name="label_system_message_conversation_verified_proteus">All fingerprints are verified (Proteus)</string>
<string name="label_system_message_conversation_started_sensitive_information_header">**Communication in Wire is always end-to-end encrypted.**</string>
<string name="label_system_message_conversation_started_sensitive_information_header_with_cells_on">**Communication in Wire is always secured.**</string>
<string name="label_system_message_conversation_started_sensitive_information_message">Everything you send and receive in this conversation is only accessible to you and other conversation participants.</string>
<string name="label_system_message_conversation_started_sensitive_information_message_with_cells_on">Messages and calls are always end-to-end encrypted, whereas files and folders are secured in transit and encrypted at rest. </string>
<string name="label_system_message_conversation_started_sensitive_information_footer">Please still be careful with who you share sensitive information.</string>
<string name="label_conversations_details_verified_proteus">Verified (Proteus)</string>
<string name="label_conversations_details_verified_mls">Verified (End-to-end Identity)</string>
Expand Down