Package 

Interface ActivityCommentList


  • 
    public interface ActivityCommentList
    
                        

    A class representing a paginated list of comments for a specific activity.

    This class provides methods to fetch and manage comments for an activity, including pagination support and real-time updates through WebSocket events. It maintains an observable state that automatically updates when comment-related events are received.

    // Create a comment list for an activity
    val commentList = feedsClient.activityCommentList(
         query = ActivityCommentsQuery(objectId = "activity-123", objectType = "activity")
    )
    
    // Fetch initial comments
    val comments = commentList.get()
    
    // Load more comments if available
    if (commentList.state.canLoadMore) {
        val moreComments = commentList.queryMoreComments()
    }
    
    // Observe state changes
    commentList.state.comments.collect { comments ->
        println("Updated comments: ${comments.size}")
    }
    • Pagination: Supports loading comments in pages with configurable limits

    • Real-time Updates: Automatically receives WebSocket events for comment changes

    • Threaded Comments: Supports nested comment replies

    • Reactions: Tracks comment reactions and updates in real-time

    • Method Detail

      • get

         abstract Result<List<ThreadedCommentData>> get()

        Fetches the initial set of comments for the activity.

        This method retrieves the first page of comments based on the query configuration. The results are automatically stored in the state and can be accessed through the state.comments property.

      • queryMoreComments

         abstract Result<List<ThreadedCommentData>> queryMoreComments(Integer limit)

        Fetches the next page of comments based on the current pagination state.

        This method retrieves the next set of comments using the pagination cursor stored in the state. It updates the state with the new comments and returns the results.

        Parameters:
        limit - The maximum number of comments to fetch in this request.
      • getState

         abstract ActivityCommentListState getState()

        An observable object representing the current state of the comment list.

        This property provides access to the current comments, pagination information, and real-time updates. The state automatically updates when WebSocket events are received for comment additions, updates, deletions, and reactions.