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:
@@ -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(
|
||||
|
||||
@@ -318,7 +318,7 @@ private fun MessageSummary(event: TimelineItem.Event, modifier: Modifier = Modif
|
||||
)
|
||||
)
|
||||
}
|
||||
content = { ContentForBody(event.content.body) }
|
||||
content = { ContentForBody(textContent) }
|
||||
}
|
||||
}
|
||||
Row(modifier = modifier) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user