Class GroupChannel

  • All Implemented Interfaces:

    
    public final class GroupChannel
    extends BaseChannel
                        

    Group channel.

    Represents a multi-user group chat channel. Supports member management, join/leave operations, group info updates, and more.

    Inherits from BaseChannel and supports message querying and unread count management.

    • Constructor Detail

      • GroupChannel

        GroupChannel(String channelId)
    • Method Detail

      • getMemberCount

         final Integer getMemberCount()

        Current member count of the group.

      • setMemberCount

         final Unit setMemberCount(Integer memberCount)

        Current member count of the group.

      • getMaxMemberCount

         final Integer getMaxMemberCount()

        Maximum allowed member count for the group.

      • setMaxMemberCount

         final Unit setMaxMemberCount(Integer maxMemberCount)

        Maximum allowed member count for the group.

      • join

         final Unit join(OperationHandler<Integer> handler)

        Joins this group.

        May join directly or may require owner/admin approval depending on the group's join permission.

        Parameters:
        handler - Callback returning the result code on success (indicates whether approval is required)
      • leave

         final Unit leave(LeaveGroupConfig config, ErrorHandler handler)

        Leaves this group.

        Parameters:
        config - Optional leave configuration for cleanup behavior
        handler - Error callback; null error indicates success
      • dismiss

         final Unit dismiss(ErrorHandler handler)

        Dismisses (dissolves) this group. Only the group owner can perform this operation.

        Parameters:
        handler - Error callback; null error indicates success
      • transferOwner

         final Unit transferOwner(TransferGroupOwnerParams params, ErrorHandler handler)

        Transfers group ownership to another user.

        Parameters:
        params - Transfer parameters including the new owner ID and whether to leave after transfer
        handler - Error callback; null error indicates success
      • updateInfo

         final Unit updateInfo(UpdateGroupInfoParams params, ErrorDetailHandler<List<String>> handler)

        Updates group information.

        Parameters:
        params - Update parameters containing the fields to modify
        handler - Callback with error details; on partial failure, the detail contains the list of failed field names
      • inviteUsers

         final Unit inviteUsers(List<String> userIds, OperationHandler<Integer> handler)

        Invites users to join this group.

        May join directly or may require the invitee's confirmation depending on the group's invite permission.

        Parameters:
        userIds - List of user IDs to invite
        handler - Callback returning the result code on success
      • kickMembers

         final Unit kickMembers(KickGroupMembersParams params, ErrorHandler handler)

        Kicks members from this group.

        Parameters:
        params - Kick parameters including user IDs and optional cleanup config
        handler - Error callback; null error indicates success
      • addManagers

         final Unit addManagers(List<String> userIds, ErrorHandler handler)

        Adds group administrators.

        Parameters:
        userIds - List of user IDs to promote to administrator
        handler - Error callback; null error indicates success
      • removeManagers

         final Unit removeManagers(List<String> userIds, ErrorHandler handler)

        Removes group administrators.

        Parameters:
        userIds - List of user IDs to demote from administrator
        handler - Error callback; null error indicates success
      • acceptInvite

         final Unit acceptInvite(String inviterId, ErrorHandler handler)

        Accepts a group invitation.

        Parameters:
        inviterId - The user ID of the inviter
        handler - Error callback; null error indicates success
      • refuseInvite

         final Unit refuseInvite(RefuseGroupInviteParams params, ErrorHandler handler)

        Refuses a group invitation.

        Parameters:
        params - Parameters including the inviter ID and optional refusal reason
        handler - Error callback; null error indicates success
      • refuseApplication

         final Unit refuseApplication(RefuseGroupApplicationParams params, ErrorHandler handler)

        Refuses a group join application (owner/admin operation).

        Parameters:
        params - Parameters including the applicant user ID and optional refusal reason
        handler - Error callback; null error indicates success
      • getMembers

         final Unit getMembers(List<String> userIds, OperationHandler<List<GroupMemberInfo>> handler)

        Gets info for specified group members.

        Parameters:
        userIds - List of user IDs to query
        handler - Callback returning the list of member info on success
      • setMemberInfo

         final Unit setMemberInfo(SetGroupMemberInfoParams params, ErrorDetailHandler<List<String>> handler)

        Sets a group member's nickname and extra info within this group.

        Parameters:
        params - Parameters including the user ID and fields to update
        handler - Callback with error details; on partial failure, the detail contains the list of failed field names
      • addFavorites

         final Unit addFavorites(List<String> userIds, ErrorHandler handler)

        Adds users to the group's special attention (favorites) list.

        Parameters:
        userIds - List of user IDs to add
        handler - Error callback; null error indicates success
      • removeFavorites

         final Unit removeFavorites(List<String> userIds, ErrorHandler handler)

        Removes users from the group's special attention (favorites) list.

        Parameters:
        userIds - List of user IDs to remove
        handler - Error callback; null error indicates success
      • getFavorites

         final Unit getFavorites(OperationHandler<List<GroupFollowDetail>> handler)

        Gets the list of users in this group's special attention (favorites) list.

        Parameters:
        handler - Callback returning the list of favorite details on success
      • getUnreadMentionedMessages

         Unit getUnreadMentionedMessages(OperationHandler<List<Message>> handler)

        Gets unread mentioned messages in this group channel.

        Returns messages sorted chronologically from oldest to newest.

        Parameters:
        handler - Callback returning the list of unread mentioned messages on success