Remove text from parent interface.

This commit is contained in:
Benoit Marty 2024-02-12 23:43:58 +01:00
parent af497e1282
commit 07c23cbcdd
2 changed files with 8 additions and 10 deletions

View file

@ -660,7 +660,9 @@ private fun ReplyToContentText(metadata: InReplyToMetadata?) {
val text = when (metadata) { val text = when (metadata) {
InReplyToMetadata.Redacted -> stringResource(id = CommonStrings.common_message_removed) InReplyToMetadata.Redacted -> stringResource(id = CommonStrings.common_message_removed)
InReplyToMetadata.UnableToDecrypt -> stringResource(id = CommonStrings.common_waiting_for_decryption_key) InReplyToMetadata.UnableToDecrypt -> stringResource(id = CommonStrings.common_waiting_for_decryption_key)
else -> metadata?.text.orEmpty() is InReplyToMetadata.Text -> metadata.text
is InReplyToMetadata.Thumbnail -> metadata.text
null -> ""
} }
val iconResourceId = when (metadata) { val iconResourceId = when (metadata) {
InReplyToMetadata.Redacted -> CompoundDrawables.ic_compound_delete InReplyToMetadata.Redacted -> CompoundDrawables.ic_compound_delete

View file

@ -43,24 +43,20 @@ import io.element.android.libraries.ui.strings.CommonStrings
@Immutable @Immutable
internal sealed interface InReplyToMetadata { internal sealed interface InReplyToMetadata {
val text: String?
data class Thumbnail( data class Thumbnail(
val attachmentThumbnailInfo: AttachmentThumbnailInfo val attachmentThumbnailInfo: AttachmentThumbnailInfo
) : InReplyToMetadata { ) : InReplyToMetadata {
override val text: String? = attachmentThumbnailInfo.textContent val text: String = attachmentThumbnailInfo.textContent.orEmpty()
} }
data class Text( data class Text(
override val text: String val text: String
) : InReplyToMetadata ) : InReplyToMetadata
abstract class Informative : InReplyToMetadata { sealed interface Informative : InReplyToMetadata
override val text: String? = null
}
data object Redacted : Informative() data object Redacted : Informative
data object UnableToDecrypt : Informative() data object UnableToDecrypt : Informative
} }
/** /**