From e0630ceac05c6c427f010c1c6651a25c940e2170 Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Thu, 20 Jan 2022 13:02:35 +0200 Subject: [PATCH] Fix mentions UI within threads --- .../internal/session/room/relation/DefaultRelationService.kt | 2 +- .../sdk/internal/session/room/send/LocalEchoEventFactory.kt | 4 ++-- .../home/room/detail/composer/MessageComposerViewModel.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt index eee553ab80..08154b9cbd 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt @@ -192,7 +192,7 @@ internal class DefaultRelationService @AssistedInject constructor( eventFactory.createThreadTextEvent( rootThreadEventId = rootThreadEventId, roomId = roomId, - text = replyInThreadText.toString(), + text = replyInThreadText, msgType = msgType, autoMarkdown = autoMarkdown, formattedText = formattedText) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt index e9244b6793..7a4edf582f 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt @@ -396,11 +396,11 @@ internal class LocalEchoEventFactory @Inject constructor( fun createThreadTextEvent( rootThreadEventId: String, roomId: String, - text: String, + text: CharSequence, msgType: String, autoMarkdown: Boolean, formattedText: String?): Event { - val content = formattedText?.let { TextContent(text, it) } ?: createTextContent(text, autoMarkdown) + val content = formattedText?.let { TextContent(text.toString(), it) } ?: createTextContent(text, autoMarkdown) return createEvent( roomId, EventType.MESSAGE, diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt index 00755a78e7..b7425af7c9 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt @@ -191,7 +191,7 @@ class MessageComposerViewModel @AssistedInject constructor( if (state.rootThreadEventId != null) { room.replyInThread( rootThreadEventId = state.rootThreadEventId, - replyInThreadText = action.text.toString(), + replyInThreadText = action.text, autoMarkdown = action.autoMarkdown) } else { room.sendTextMessage(action.text, autoMarkdown = action.autoMarkdown)