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 d694a6de34c..7087bbf4d6d 100644 --- a/stream-chat-android-client/api/stream-chat-android-client.api +++ b/stream-chat-android-client/api/stream-chat-android-client.api @@ -78,6 +78,8 @@ public final class io/getstream/chat/android/client/ChatClient { public final fun getRepliesMore (Ljava/lang/String;Ljava/lang/String;I)Lio/getstream/result/call/Call; public final fun getSyncHistory (Ljava/util/List;Ljava/lang/String;)Lio/getstream/result/call/Call; public final fun getSyncHistory (Ljava/util/List;Ljava/util/Date;)Lio/getstream/result/call/Call; + public final fun getThread (IIIZI)Lio/getstream/result/call/Call; + public static synthetic fun getThread$default (Lio/getstream/chat/android/client/ChatClient;IIIZIILjava/lang/Object;)Lio/getstream/result/call/Call; public static final fun getVERSION_PREFIX_HEADER ()Lio/getstream/chat/android/client/header/VersionPrefixHeader; public final fun getVideoCallToken (Ljava/lang/String;)Lio/getstream/result/call/Call; public static final fun handlePushMessage (Lio/getstream/chat/android/models/PushMessage;)V diff --git a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/ChatClient.kt b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/ChatClient.kt index a1947986f99..0b0c13c38f3 100644 --- a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/ChatClient.kt +++ b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/ChatClient.kt @@ -161,6 +161,7 @@ import io.getstream.chat.android.models.Mute import io.getstream.chat.android.models.PushMessage import io.getstream.chat.android.models.Reaction import io.getstream.chat.android.models.SearchMessagesResult +import io.getstream.chat.android.models.Thread import io.getstream.chat.android.models.UploadAttachmentsNetworkType import io.getstream.chat.android.models.UploadedFile import io.getstream.chat.android.models.User @@ -3051,6 +3052,33 @@ internal constructor( return api.downloadFile(fileUrl) } + /** + * Get a list of threads for the current user. + * + * @param replyLimit The number of latest replies to fetch per thread. Defaults to 2. + * @param participantLimit The number of thread participants to request per thread. Defaults to 100. + * @param limit The number of threads to return. Defaults to 10. + * @param watch If true, all the channels corresponding to threads returned in response will be watched. + * Defaults to true. + * @param memberLimit The number of members to request per thread. Defaults to 100. + */ + @CheckResult + public fun getThread( + replyLimit: Int = 2, + participantLimit: Int = 100, + limit: Int = 10, + watch: Boolean = true, + memberLimit: Int = 100, + ): Call> { + return api.getThreads( + replyLimit = replyLimit, + participantLimit = participantLimit, + limit = limit, + watch = watch, + memberLimit = memberLimit, + ) + } + private fun warmUp() { if (config.warmUp) { api.warmUp()