From 31909e3a68dd0d54368f49b0fdf11396ea9ade1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jc=20Mi=C3=B1arro?= Date: Fri, 11 Oct 2024 12:50:38 +0200 Subject: [PATCH 1/4] Create a new method to know if a message belong to a thread --- .../api/stream-chat-android-client.api | 1 + .../chat/android/client/utils/message/MessageUtils.kt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/stream-chat-android-client/api/stream-chat-android-client.api b/stream-chat-android-client/api/stream-chat-android-client.api index e01068c1764..0a2f81eee07 100644 --- a/stream-chat-android-client/api/stream-chat-android-client.api +++ b/stream-chat-android-client/api/stream-chat-android-client.api @@ -2879,6 +2879,7 @@ public final class io/getstream/chat/android/client/utils/internal/toggle/Toggle } public final class io/getstream/chat/android/client/utils/message/MessageUtils { + public static final fun belongsToThread (Lio/getstream/chat/android/models/Message;)Z public static final fun hasAudioRecording (Lio/getstream/chat/android/models/Message;)Z public static final fun isDeleted (Lio/getstream/chat/android/models/Message;)Z public static final fun isEphemeral (Lio/getstream/chat/android/models/Message;)Z diff --git a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/utils/message/MessageUtils.kt b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/utils/message/MessageUtils.kt index 77257c21bb4..a44f4ddb980 100644 --- a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/utils/message/MessageUtils.kt +++ b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/utils/message/MessageUtils.kt @@ -155,6 +155,11 @@ public fun Message.isThreadStart(): Boolean = threadParticipants.isNotEmpty() */ public fun Message.isThreadReply(): Boolean = !parentId.isNullOrEmpty() +/** + * @return If the message belongs to a thread. + */ +public fun Message.belongsToThread(): Boolean = this.isThreadStart() || this.isThreadReply() + /** * @return If the message contains quoted message. */ From 299bcc26f490f6846a6c1fc678339543dd8dcaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jc=20Mi=C3=B1arro?= Date: Fri, 11 Oct 2024 17:50:02 +0200 Subject: [PATCH 2/4] Create a method to access to a thread from any message that belong to the thread --- .../api/stream-chat-android-ui-common.api | 1 + .../feature/messages/list/MessageListController.kt | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api b/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api index 3ba493817f7..4fb992daece 100644 --- a/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api +++ b/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api @@ -185,6 +185,7 @@ public final class io/getstream/chat/android/ui/common/feature/messages/list/Mes public final fun muteUser (Ljava/lang/String;Ljava/lang/Integer;)V public static synthetic fun muteUser$default (Lio/getstream/chat/android/ui/common/feature/messages/list/MessageListController;Ljava/lang/String;Ljava/lang/Integer;ILjava/lang/Object;)V public final fun onCleared ()V + public final fun openRelatedThread (Lio/getstream/chat/android/models/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun performGiphyAction (Lio/getstream/chat/android/ui/common/state/messages/list/GiphyAction;)V public final fun performMessageAction (Lio/getstream/chat/android/ui/common/state/messages/MessageAction;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun pinMessage (Lio/getstream/chat/android/models/Message;)V diff --git a/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt b/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt index 7d8cd55dead..4dbf7de1bc3 100644 --- a/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt +++ b/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt @@ -31,6 +31,7 @@ import io.getstream.chat.android.client.utils.message.isGiphy import io.getstream.chat.android.client.utils.message.isModerationBounce import io.getstream.chat.android.client.utils.message.isModerationError import io.getstream.chat.android.client.utils.message.isSystem +import io.getstream.chat.android.client.utils.message.isThreadStart import io.getstream.chat.android.core.internal.InternalStreamChatApi import io.getstream.chat.android.core.internal.coroutines.DispatcherProvider import io.getstream.chat.android.core.internal.exhaustive @@ -1146,6 +1147,18 @@ public class MessageListController( } } + /** + * Open the thread for the given message. + * If the message is a thread start, it will open the thread. + * If the message is a reply, it will open the thread for the parent message. + */ + public suspend fun openRelatedThread(message: Message) { + when (message.isThreadStart()) { + true -> enterThreadMode(message) + else -> message.parentId?.let { enterThreadSequential(it) } + } + } + /** * Changes the current [_mode] to be [MessageMode.MessageThread] and uses [ChatClient] to get the [ThreadState] for * the current thread. From dcb0dce4d1ebb9b0a46d874c47661d4afe925d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jc=20Mi=C3=B1arro?= Date: Fri, 11 Oct 2024 17:51:22 +0200 Subject: [PATCH 3/4] Show Thread Footnote on reply messages on the channel --- .../ui/components/messages/MessageFooter.kt | 19 +++++++++++-------- .../compose/ui/messages/list/MessageItem.kt | 4 ++-- .../messages/MessageListViewModel.kt | 2 +- .../src/main/res/values-en/strings.xml | 4 ---- .../src/main/res/values/strings.xml | 8 +++++--- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/MessageFooter.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/MessageFooter.kt index 06cb688ca22..20cebf474da 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/MessageFooter.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/MessageFooter.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp +import io.getstream.chat.android.client.utils.message.belongsToThread import io.getstream.chat.android.compose.R import io.getstream.chat.android.compose.state.DateFormatType import io.getstream.chat.android.compose.ui.components.Timestamp @@ -52,19 +53,21 @@ public fun MessageFooter( messageItem: MessageItemState, ) { val message = messageItem.message - val hasThread = message.threadParticipants.isNotEmpty() val alignment = ChatTheme.messageAlignmentProvider.provideMessageAlignment(messageItem) - if (hasThread && !messageItem.isInThread) { - val replyCount = message.replyCount + if (message.belongsToThread() && !messageItem.isInThread) { + val threadFooterText = when (message.replyCount) { + 0 -> LocalContext.current.resources.getString(R.string.stream_compose_thread_reply) + else -> LocalContext.current.resources.getQuantityString( + R.plurals.stream_compose_message_list_thread_footnote, + message.replyCount, + message.replyCount, + ) + } MessageThreadFooter( participants = message.threadParticipants, messageAlignment = alignment, - text = LocalContext.current.resources.getQuantityString( - R.plurals.stream_compose_message_list_thread_footnote, - replyCount, - replyCount, - ), + text = threadFooterText, ) } diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt index c96668028b2..22993f8c000 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt @@ -55,11 +55,11 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp +import io.getstream.chat.android.client.utils.message.belongsToThread import io.getstream.chat.android.client.utils.message.isDeleted import io.getstream.chat.android.client.utils.message.isGiphyEphemeral import io.getstream.chat.android.client.utils.message.isPinned import io.getstream.chat.android.client.utils.message.isPoll -import io.getstream.chat.android.client.utils.message.isThreadStart import io.getstream.chat.android.compose.R import io.getstream.chat.android.compose.state.mediagallerypreview.MediaGalleryPreviewResult import io.getstream.chat.android.compose.state.reactionoptions.ReactionOptionItemState @@ -196,7 +196,7 @@ public fun MessageItem( Modifier.combinedClickable( interactionSource = remember { MutableInteractionSource() }, indication = null, - onClick = { if (message.isThreadStart()) onThreadClick(message) }, + onClick = { if (message.belongsToThread()) onThreadClick(message) }, onLongClick = { if (!message.isUploading()) onLongItemClick(message) }, ) } diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel.kt index 85e5c3359ff..ae4427fcd63 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel.kt @@ -250,7 +250,7 @@ public class MessageListViewModel( */ public fun openMessageThread(message: Message) { viewModelScope.launch { - messageListController.enterThreadMode(message) + messageListController.openRelatedThread(message) } } diff --git a/stream-chat-android-compose/src/main/res/values-en/strings.xml b/stream-chat-android-compose/src/main/res/values-en/strings.xml index 88631047081..8902d10ea9c 100644 --- a/stream-chat-android-compose/src/main/res/values-en/strings.xml +++ b/stream-chat-android-compose/src/main/res/values-en/strings.xml @@ -64,10 +64,6 @@ Send Cancel Shuffle - - Thread Reply - %d Thread Replies - %d Reply %d Replies diff --git a/stream-chat-android-compose/src/main/res/values/strings.xml b/stream-chat-android-compose/src/main/res/values/strings.xml index cbec8b5a76c..c98e1541562 100644 --- a/stream-chat-android-compose/src/main/res/values/strings.xml +++ b/stream-chat-android-compose/src/main/res/values/strings.xml @@ -65,9 +65,11 @@ Cancel Shuffle Edited - - Thread Reply - %d Thread Replies + Thread Reply + %d Thread Replies + + @string/stream_compose_message_list_thread_footnote_thread_reply + @string/stream_compose_message_list_thread_footnote_thread_replies %d Reply From 773dbca210e126b3a9b543873a69e06f3bc859fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jc=20Mi=C3=B1arro?= Date: Fri, 11 Oct 2024 19:30:43 +0200 Subject: [PATCH 4/4] Show Thread Footnote on reply messages on the channel (XML) --- .../api/stream-chat-android-ui-components.api | 16 ++++++++++ .../feature/messages/list/MessageListView.kt | 29 ++++++++++++++----- .../adapter/view/internal/FootnoteView.kt | 11 +++++-- .../decorator/internal/FootnoteDecorator.kt | 10 +++---- .../messages/MessageListViewModel.kt | 17 +++++++++++ .../messages/MessageListViewModelBinding.kt | 1 + .../main/res/values/strings_message_list.xml | 8 +++-- 7 files changed, 73 insertions(+), 19 deletions(-) diff --git a/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api b/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api index 16bc3d682a2..22d7c275049 100644 --- a/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api +++ b/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api @@ -2225,6 +2225,7 @@ public final class io/getstream/chat/android/ui/feature/messages/list/MessageLis public final fun setOnUserClickListener (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$OnUserClickListener;)V public final fun setOnUserReactionClickListener (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$OnUserReactionClickListener;)V public final fun setOnViewPollResultClickListener (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$OnViewPollResultClickListener;)V + public final fun setOpenThreadHandler (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$OpenThreadHandler;)V public final fun setOwnCapabilities (Ljava/util/Set;)V public final fun setReactionViewClickListener (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$ReactionViewClickListener;)V public final fun setReactionsEnabled (Z)V @@ -2476,6 +2477,10 @@ public abstract interface class io/getstream/chat/android/ui/feature/messages/li public abstract fun onViewPollResultClick (Lio/getstream/chat/android/models/Poll;)Z } +public abstract interface class io/getstream/chat/android/ui/feature/messages/list/MessageListView$OpenThreadHandler { + public abstract fun onOpenThread (Lio/getstream/chat/android/models/Message;)V +} + public abstract interface class io/getstream/chat/android/ui/feature/messages/list/MessageListView$ReactionViewClickListener { public abstract fun onReactionViewClick (Lio/getstream/chat/android/models/Message;)V } @@ -4553,6 +4558,17 @@ public final class io/getstream/chat/android/ui/viewmodel/messages/MessageListVi public fun toString ()Ljava/lang/String; } +public final class io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event$OpenThread : io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event { + public fun (Lio/getstream/chat/android/models/Message;)V + public final fun component1 ()Lio/getstream/chat/android/models/Message; + public final fun copy (Lio/getstream/chat/android/models/Message;)Lio/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event$OpenThread; + public static synthetic fun copy$default (Lio/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event$OpenThread;Lio/getstream/chat/android/models/Message;ILjava/lang/Object;)Lio/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event$OpenThread; + public fun equals (Ljava/lang/Object;)Z + public final fun getMessage ()Lio/getstream/chat/android/models/Message; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + public final class io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event$PinMessage : io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel$Event { public fun (Lio/getstream/chat/android/models/Message;)V public final fun component1 ()Lio/getstream/chat/android/models/Message; diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/MessageListView.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/MessageListView.kt index 0a9b37ab1b0..5ecebbf706a 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/MessageListView.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/MessageListView.kt @@ -37,6 +37,7 @@ import io.getstream.chat.android.client.ChatClient import io.getstream.chat.android.client.utils.attachment.isGiphy import io.getstream.chat.android.client.utils.attachment.isImage import io.getstream.chat.android.client.utils.attachment.isVideo +import io.getstream.chat.android.client.utils.message.belongsToThread import io.getstream.chat.android.client.utils.message.isModerationError import io.getstream.chat.android.client.utils.message.isThreadReply import io.getstream.chat.android.core.ExperimentalStreamChatApi @@ -197,6 +198,9 @@ public class MessageListView : ConstraintLayout { private var threadStartHandler = ThreadStartHandler { throw IllegalStateException("onStartThreadHandler must be set.") } + private var openThreadHandler = OpenThreadHandler { + throw IllegalStateException("onStartThreadHandler must be set.") + } private var replyMessageClickListener = OnReplyMessageClickListener { // no-op false @@ -341,8 +345,8 @@ public class MessageListView : ConstraintLayout { val replyTo = message.replyTo when { - message.replyCount > 0 -> { - threadStartHandler.onStartThread(message) + message.belongsToThread() -> { + openThreadHandler.onOpenThread(message) true } @@ -452,12 +456,8 @@ public class MessageListView : ConstraintLayout { private val defaultThreadClickListener = OnThreadClickListener { message -> - if (message.replyCount > 0) { - threadStartHandler.onStartThread(message) - true - } else { - false - } + message.belongsToThread() + .also { if (it) openThreadHandler.onOpenThread(message) } } private val attachmentGalleryDestination = @@ -1856,6 +1856,15 @@ public class MessageListView : ConstraintLayout { this.threadStartHandler = threadStartHandler } + /** + * Sets the handler used when opening a thread. + * + * @param openThreadHandler The handler to use. + */ + public fun setOpenThreadHandler(openThreadHandler: OpenThreadHandler) { + this.openThreadHandler = openThreadHandler + } + /** * Sets the handler used when the message is going to be flagged. * @@ -2462,6 +2471,10 @@ public class MessageListView : ConstraintLayout { public fun onStartThread(message: Message) } + public fun interface OpenThreadHandler { + public fun onOpenThread(message: Message) + } + public fun interface GiphySendHandler { public fun onSendGiphy(action: GiphyAction) } diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/internal/FootnoteView.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/internal/FootnoteView.kt index da9e9f10b15..e2c9caf66e1 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/internal/FootnoteView.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/internal/FootnoteView.kt @@ -112,9 +112,14 @@ internal class FootnoteView : LinearLayoutCompat { root.isVisible = true threadsOrnamentLeft.isVisible = !isMine threadsOrnamentRight.isVisible = isMine - - threadRepliesButton.text = - resources.getQuantityString(R.plurals.stream_ui_message_list_thread_reply, replyCount, replyCount) + threadRepliesButton.text = when (replyCount) { + 0 -> resources.getString(R.string.stream_ui_message_list_thread_footnote_thread_reply) + else -> resources.getQuantityString( + R.plurals.stream_ui_message_list_thread_footnote, + replyCount, + replyCount, + ) + } threadRepliesButton.setTextStyle(style.textStyleThreadCounter) } setupUserAvatars(isMine, threadParticipants) diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt index bcfae43da16..e07520ef14a 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt @@ -21,6 +21,7 @@ import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.core.view.isVisible +import io.getstream.chat.android.client.utils.message.belongsToThread import io.getstream.chat.android.client.utils.message.isDeleted import io.getstream.chat.android.client.utils.message.isEphemeral import io.getstream.chat.android.client.utils.message.isGiphy @@ -243,11 +244,10 @@ internal class FootnoteDecorator( anchorView: View, data: MessageListItem.MessageItem, ) { - val isSimpleFootnoteMode = data.message.replyCount == 0 || data.isThreadMode - if (isSimpleFootnoteMode) { - setupSimpleFootnoteWithRootConstraints(footnoteView, root, anchorView, data) - } else { - setupThreadFootnote(footnoteView, root, threadGuideline, data) + val isThreadFootnote = data.message.belongsToThread() && !data.isThreadMode + when (isThreadFootnote) { + true -> setupThreadFootnote(footnoteView, root, threadGuideline, data) + false -> setupSimpleFootnoteWithRootConstraints(footnoteView, root, anchorView, data) } footnoteView.applyGravity(data.isMine) } diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel.kt index afafbf214cc..695f16ebdad 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel.kt @@ -228,6 +228,7 @@ public class MessageListViewModel( is Event.BottomEndRegionReached -> onBottomEndRegionReached(event.messageId) is Event.LastMessageRead -> messageListController.markLastMessageRead() is Event.ThreadModeEntered -> onThreadModeEntered(event.parentMessage) + is Event.OpenThread -> onOpenThread(event.message) is Event.BackButtonPressed -> onBackButtonPressed() is Event.MarkAsUnreadMessage -> messageListController.markUnread(event.message) is Event.DeleteMessage -> messageListController.deleteMessage(event.message, event.hard) @@ -411,6 +412,17 @@ public class MessageListViewModel( } } + /** + * Handles an event to open a thread. + * + * @param message The message to open the thread for. + */ + private fun onOpenThread(message: Message) { + viewModelScope.launch { + messageListController.openRelatedThread(message) + } + } + /** * Handles reacting to messages while taking into account if unique reactions are enforced. * @@ -527,6 +539,11 @@ public class MessageListViewModel( */ public data class ThreadModeEntered(val parentMessage: Message) : Event() + /** + * When the user + */ + public data class OpenThread(val message: Message) : Event() + /** * When the user deletes a message. * diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModelBinding.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModelBinding.kt index 26b0644e63b..2fffd036aa9 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModelBinding.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModelBinding.kt @@ -66,6 +66,7 @@ public fun MessageListViewModel.bindView( view.setLastMessageReadHandler { onEvent(LastMessageRead) } view.setMessageDeleteHandler { onEvent(DeleteMessage(it, hard = false)) } view.setThreadStartHandler { onEvent(ThreadModeEntered(it)) } + view.setOpenThreadHandler { onEvent(MessageListViewModel.Event.OpenThread(it)) } view.setMessageFlagHandler { onEvent( FlagMessage( diff --git a/stream-chat-android-ui-components/src/main/res/values/strings_message_list.xml b/stream-chat-android-ui-components/src/main/res/values/strings_message_list.xml index 02393eb798f..8f5c9a6b29b 100644 --- a/stream-chat-android-ui-components/src/main/res/values/strings_message_list.xml +++ b/stream-chat-android-ui-components/src/main/res/values/strings_message_list.xml @@ -32,9 +32,11 @@ %1$s / %2$s Pinned by %s You - - Thread Reply - %d Thread Replies + Thread reply + %d Thread Replies + + @string/stream_ui_message_list_thread_footnote_thread_reply + @string/stream_ui_message_list_thread_footnote_thread_replies %d Reply