getThread method

  1. @override
Future<ChatResult<ChatPaginatedResponse<ChatMessage>>> getThread(
  1. String roomId,
  2. String messageId, {
  3. ChatCursorPaginationParams? pagination,
})
override

Fetches the thread (replies) for a given parent message.

Use for Slack-style threaded reply panels. Cursor-paginated like list; the parent message itself is NOT included in the result — fetch separately via get (or render the cached copy) for the thread header.

Implementation

@override
Future<ChatResult<ChatPaginatedResponse<ChatMessage>>> getThread(
  String roomId,
  String messageId, {
  ChatCursorPaginationParams? pagination,
}) async {
  final messages = _client._messages[roomId] ?? [];
  final thread = messages.where((m) => m.id == messageId).toList();
  return ChatSuccess(ChatPaginatedResponse(items: thread, hasMore: false));
}