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 a51fdf9fb8
commit 563aaa6102
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}
}

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1f8750e66aa2a60198fe68d2e3185bcf5a8708df81502f33c394d72f7b20a30
size 42765
oid sha256:e8e50be96a1b204b8187fd76802650569a740a927739135a6b6307481f2d5568
size 40453

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fbb1233cf288e6ffc1aaa7136b56c412699897d7edd20bef82784562e302bf40
size 41215
oid sha256:83f6cbcdbc00c49aed762339769e0f639604286406c46b1336b7757e2aad8b41
size 38641