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) {
InReplyToMetadata.Redacted -> stringResource(id = CommonStrings.common_message_removed)
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) {
InReplyToMetadata.Redacted -> CompoundDrawables.ic_compound_delete

View File

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