Browse Source

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
pull/1679/head
Marco Romano 11 months ago committed by GitHub
parent
commit
563aaa6102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt
  2. 2
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt
  3. 2
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt
  4. BIN
      tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.actionlist_null_SheetContent-D-1_1_null_7,NEXUS_5,1.0,en].png
  5. BIN
      tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.actionlist_null_SheetContent-N-1_2_null_7,NEXUS_5,1.0,en].png

2
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt

@ -332,7 +332,7 @@ class MessagesPresenter @AssistedInject constructor( @@ -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(

2
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt

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

2
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt

@ -618,7 +618,6 @@ private fun attachmentThumbnailInfoForInReplyTo(inReplyTo: InReplyTo.Ready): Att @@ -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 { @@ -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
}
}

BIN
tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.actionlist_null_SheetContent-D-1_1_null_7,NEXUS_5,1.0,en].png (Stored with Git LFS)

Binary file not shown.

BIN
tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.actionlist_null_SheetContent-N-1_2_null_7,NEXUS_5,1.0,en].png (Stored with Git LFS)

Binary file not shown.
Loading…
Cancel
Save