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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGroupChannel.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegermemberCountprivate IntegermaxMemberCountprivate final StringchannelIdprivate final ChannelTypechannelTypeprivate final IntegerunreadCountprivate final BooleanisPinnedprivate final LongoperationTimeprivate final Stringdraftprivate final MessagelatestMessageprivate final IntegermentionedCountprivate final IntegermentionedMeCountprivate final ChannelNoDisturbLevelnoDisturbLevelprivate final TranslateStrategytranslateStrategyprivate final BooleanincludeRobotprivate final EditedMessageDrafteditedMessageDraftpublic final static GroupChannel.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description GroupChannel(String channelId)
-
Method Summary
Modifier and Type Method Description final IntegergetMemberCount()Current member count of the group. final UnitsetMemberCount(Integer memberCount)Current member count of the group. final IntegergetMaxMemberCount()Maximum allowed member count for the group. final UnitsetMaxMemberCount(Integer maxMemberCount)Maximum allowed member count for the group. final Unitjoin(OperationHandler<Integer> handler)Joins this group. final Unitleave(LeaveGroupConfig config, ErrorHandler handler)Leaves this group. final Unitdismiss(ErrorHandler handler)Dismisses (dissolves) this group. final UnittransferOwner(TransferGroupOwnerParams params, ErrorHandler handler)Transfers group ownership to another user. final UnitupdateInfo(UpdateGroupInfoParams params, ErrorDetailHandler<List<String>> handler)Updates group information. final UnitinviteUsers(List<String> userIds, OperationHandler<Integer> handler)Invites users to join this group. final UnitkickMembers(KickGroupMembersParams params, ErrorHandler handler)Kicks members from this group. final UnitaddManagers(List<String> userIds, ErrorHandler handler)Adds group administrators. final UnitremoveManagers(List<String> userIds, ErrorHandler handler)Removes group administrators. final UnitacceptInvite(String inviterId, ErrorHandler handler)Accepts a group invitation. final UnitrefuseInvite(RefuseGroupInviteParams params, ErrorHandler handler)Refuses a group invitation. final UnitacceptApplication(AcceptGroupApplicationParams params, OperationHandler<Integer> handler)Accepts a group join application (owner/admin operation). final UnitrefuseApplication(RefuseGroupApplicationParams params, ErrorHandler handler)Refuses a group join application (owner/admin operation). final UnitgetMembers(List<String> userIds, OperationHandler<List<GroupMemberInfo>> handler)Gets info for specified group members. final UnitsetMemberInfo(SetGroupMemberInfoParams params, ErrorDetailHandler<List<String>> handler)Sets a group member's nickname and extra info within this group. final UnitaddFavorites(List<String> userIds, ErrorHandler handler)Adds users to the group's special attention (favorites) list. final UnitremoveFavorites(List<String> userIds, ErrorHandler handler)Removes users from the group's special attention (favorites) list. final UnitgetFavorites(OperationHandler<List<GroupFollowDetail>> handler)Gets the list of users in this group's special attention (favorites) list. UnitgetUnreadMentionedMessages(OperationHandler<List<Message>> handler)Gets unread mentioned messages in this group channel. -
Methods inherited from class ai.nexconn.chat.channel.BaseChannel
clearDraft, clearUnreadCount, delete, deleteLocalMessages, deleteMessageForAll, deleteMessagesForMe, deleteMessagesForMeByTimestamp, deleteTags, equals, getChannelId, getChannelType, getDraft, getEditedMessageDraft, getFirstUnreadMessage, getIncludeRobot, getLatestMessage, getMentionedCount, getMentionedMeCount, getMessageReadReceiptInfo, getMessageReadReceiptInfoByIdentifiers, getMessagesAroundTime, getMessagesReadReceiptByUsers, getNoDisturbLevel, getOperationTime, getTags, getTranslateStrategy, getUnreadCount, hashCode, insertMessages, isPinned, modifyMessage, pin, reload, saveDraft, sendMediaMessage, sendMessage, sendReadReceiptResponse, setNoDisturbLevel, toString, unpin -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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 behaviorhandler- Error callback;nullerror indicates success
-
dismiss
final Unit dismiss(ErrorHandler handler)
Dismisses (dissolves) this group. Only the group owner can perform this operation.
- Parameters:
handler- Error callback;nullerror 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 transferhandler- Error callback;nullerror indicates success
-
updateInfo
final Unit updateInfo(UpdateGroupInfoParams params, ErrorDetailHandler<List<String>> handler)
Updates group information.
- Parameters:
params- Update parameters containing the fields to modifyhandler- 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 invitehandler- 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 confighandler- Error callback;nullerror indicates success
-
addManagers
final Unit addManagers(List<String> userIds, ErrorHandler handler)
Adds group administrators.
- Parameters:
userIds- List of user IDs to promote to administratorhandler- Error callback;nullerror indicates success
-
removeManagers
final Unit removeManagers(List<String> userIds, ErrorHandler handler)
Removes group administrators.
- Parameters:
userIds- List of user IDs to demote from administratorhandler- Error callback;nullerror indicates success
-
acceptInvite
final Unit acceptInvite(String inviterId, ErrorHandler handler)
Accepts a group invitation.
- Parameters:
inviterId- The user ID of the inviterhandler- Error callback;nullerror indicates success
-
refuseInvite
final Unit refuseInvite(RefuseGroupInviteParams params, ErrorHandler handler)
Refuses a group invitation.
- Parameters:
params- Parameters including the inviter ID and optional refusal reasonhandler- Error callback;nullerror indicates success
-
acceptApplication
final Unit acceptApplication(AcceptGroupApplicationParams params, OperationHandler<Integer> handler)
Accepts a group join application (owner/admin operation).
- Parameters:
params- Parameters including the applicant user ID and optional inviter IDhandler- Callback returning the result code on 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 reasonhandler- Error callback;nullerror 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 queryhandler- 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 updatehandler- 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 addhandler- Error callback;nullerror 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 removehandler- Error callback;nullerror 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
-
-
-
-