Don't show body in replies to voice messages but rather show "Voice message" string (#1673)

Story: https://github.com/vector-im/element-meta/issues/2106
This commit is contained in:
Marco Romano
2023-10-27 23:57:05 +02:00
committed by GitHub
parent ec198ce2e9
commit 08e2bed5db
5 changed files with 7 additions and 7 deletions

View File

@@ -332,7 +332,7 @@ class MessagesPresenter @AssistedInject constructor(
type = AttachmentThumbnailType.Audio,
)
is TimelineItemVoiceContent -> AttachmentThumbnailInfo(
textContent = targetEvent.content.body,
textContent = textContent,
type = AttachmentThumbnailType.Voice,
)
is TimelineItemLocationContent -> AttachmentThumbnailInfo(

View File

@@ -318,7 +318,7 @@ private fun MessageSummary(event: TimelineItem.Event, modifier: Modifier = Modif
)
)
}
content = { ContentForBody(event.content.body) }
content = { ContentForBody(textContent) }
}
}
Row(modifier = modifier) {

View File

@@ -618,7 +618,6 @@ private fun attachmentThumbnailInfoForInReplyTo(inReplyTo: InReplyTo.Ready): Att
type = AttachmentThumbnailType.Audio,
)
is VoiceMessageType -> AttachmentThumbnailInfo(
textContent = messageContent.body,
type = AttachmentThumbnailType.Voice,
)
else -> null
@@ -630,6 +629,7 @@ private fun textForInReplyTo(inReplyTo: InReplyTo.Ready): String {
val messageContent = inReplyTo.content as? MessageContent ?: return ""
return when (messageContent.type) {
is LocationMessageType -> stringResource(CommonStrings.common_shared_location)
is VoiceMessageType -> stringResource(CommonStrings.common_voice_message)
else -> messageContent.body
}
}