Skip to content

Commit

Permalink
Expose a new method to get Threads
Browse files Browse the repository at this point in the history
  • Loading branch information
JcMinarro committed May 17, 2024
1 parent 984591c commit 9d4143e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stream-chat-android-client/api/stream-chat-android-client.api
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<List<Thread>> {
return api.getThreads(
replyLimit = replyLimit,
participantLimit = participantLimit,
limit = limit,
watch = watch,
memberLimit = memberLimit,
)
}

private fun warmUp() {
if (config.warmUp) {
api.warmUp()
Expand Down

0 comments on commit 9d4143e

Please sign in to comment.