From c626100ae19433892dd8e9666f0809ebc0d1f82b Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Tue, 13 Dec 2022 10:42:23 +0100 Subject: [PATCH] Disable unnecessary reply fallback processing We have rich replies! Change-Id: Ifc5f41471f32e0a60e23f41c7fa9a51f25865d77 --- .../room/detail/timeline/factory/MessageItemFactory.kt | 7 +++++-- .../timeline/render/ProcessBodyOfReplyToEventUseCase.kt | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt index 9abd319ec2..e0ac2744fa 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -602,6 +602,7 @@ class MessageItemFactory @Inject constructor( } } + @Suppress("UNUSED_PARAMETER") private fun buildFormattedTextItem( matrixFormattedBody: String, informationData: MessageInformationData, @@ -610,10 +611,12 @@ class MessageItemFactory @Inject constructor( attributes: AbsMessageItem.Attributes, replyToContent: ReplyToContent?, ): MessageTextItem? { - val processedBody = replyToContent + /* + val processedBody = matrixFormattedBodyreplyToContent ?.let { processBodyOfReplyToEventUseCase.execute(roomId, matrixFormattedBody, it) } ?: matrixFormattedBody - val compressed = htmlCompressor.compress(processedBody) + */ + val compressed = htmlCompressor.compress(matrixFormattedBody) val renderedFormattedBody = htmlRenderer.get().render(compressed, pillsPostProcessor) as Spanned val pseudoEmojiBody = htmlRenderer.get().render(customToPseudoEmoji(compressed), pillsPostProcessor) as Spanned return buildMessageTextItem( diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/render/ProcessBodyOfReplyToEventUseCase.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/render/ProcessBodyOfReplyToEventUseCase.kt index 2197d89a2c..0becaa40f4 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/render/ProcessBodyOfReplyToEventUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/render/ProcessBodyOfReplyToEventUseCase.kt @@ -42,6 +42,7 @@ class ProcessBodyOfReplyToEventUseCase @Inject constructor( private val stringProvider: StringProvider, ) { + @Deprecated("SchildiChat doesn't need this, we have rich replies!") fun execute(roomId: String, matrixFormattedBody: String, replyToContent: ReplyToContent): String { val repliedToEvent = replyToContent.eventId?.let { getEvent(it, roomId) } val breakingLineIndex = matrixFormattedBody.indexOf(BREAKING_LINE)