hyphenate_SDK4.0 5.0.0
hyphenate java IM SDK
 
Loading...
Searching...
No Matches
com.hyphenate.chat.EMGroup Class Reference

Classes

enum  EMGroupPermissionType
 

Public Member Functions

String getGroupId ()
 
String getGroupName ()
 
String getGroupAvatar ()
 
String getDescription ()
 
boolean isPublic ()
 
boolean isMemberAllowToInvite ()
 
boolean isJoinApprovalRequired ()
 
int getMaxUserCount ()
 
boolean isMsgBlocked ()
 
String getOwner ()
 
String groupSubject ()
 
List< String > getMembers ()
 
int getMemberCount ()
 
String toString ()
 
List< String > getAdminList ()
 
List< String > getUsers ()
 
List< String > getBlackList ()
 
List< String > getMuteList ()
 
List< String > getWhiteList ()
 
boolean isAllMemberMuted ()
 
String getExtension ()
 
String getAnnouncement ()
 
List< EMMucSharedFilegetShareFileList ()
 
EMGroupPermissionType getGroupPermissionType ()
 
boolean isDisabled ()
 

Detailed Description

The group class.

Member Function Documentation

◆ getAdminList()

List< String > com.hyphenate.chat.EMGroup.getAdminList ( )

Gets the admin list of the group.

Be sure to fetch the detail specification of the group from the server first, see EMGroupManager#getGroupFromServer(String).

Returns
The admin list of the group.

◆ getAnnouncement()

String com.hyphenate.chat.EMGroup.getAnnouncement ( )

Gets the group announcement. If no announcement is found from the server, the return may be empty.

Reference: You can also call the method: EMGroupManager#fetchGroupAnnouncement(String) to get the group announcement. As for its asynchronous method, see EMGroupManager#asyncFetchGroupAnnouncement(String, EMValueCallBack).

Returns
The content of the group announcement.

◆ getBlackList()

List< String > com.hyphenate.chat.EMGroup.getBlackList ( )

Gets the blocklist of the group.

If no blocklist is found from the server, the return may be empty.

Reference: To fetch the blocklist, call EMGroupManager#fetchGroupBlackList(String, int, int).

Only the group owner or admin can call this method.

You also can call it's asynchronous method as follows: EMGroupManager#asyncFetchGroupBlackList(String, int, int, EMValueCallBack).

Returns
The blocklist.

◆ getDescription()

String com.hyphenate.chat.EMGroup.getDescription ( )

Gets the group description.

Returns
The group description.

◆ getExtension()

String com.hyphenate.chat.EMGroup.getExtension ( )

Gets the customized extension of the group.

Returns
The customized extension of the group.

◆ getGroupAvatar()

String com.hyphenate.chat.EMGroup.getGroupAvatar ( )

Gets the group vatar.

Returns
The group avatar url.

◆ getGroupId()

String com.hyphenate.chat.EMGroup.getGroupId ( )

Gets the group ID.

Returns
The group ID.

◆ getGroupName()

String com.hyphenate.chat.EMGroup.getGroupName ( )

Gets the group name.

Returns
The group name.

◆ getGroupPermissionType()

EMGroupPermissionType com.hyphenate.chat.EMGroup.getGroupPermissionType ( )

Gets the current user's role in group.

Returns
Returns the permission type of the user in a group, see EMGroupPermissionType.

◆ getMaxUserCount()

int com.hyphenate.chat.EMGroup.getMaxUserCount ( )

The max number of group members allowed in a group. The param is set when the group is created.

Be sure to fetch the detail specification of the group from the server first, see EMGroupManager#getGroupFromServer(String). If not, the SDK returns 0.

Returns
The allowed max number of group members.

◆ getMemberCount()

int com.hyphenate.chat.EMGroup.getMemberCount ( )

Gets the member count of the group.

This includes the group owner, administrators, and regular members.

Returns
The count.

◆ getMembers()

List< String > com.hyphenate.chat.EMGroup.getMembers ( )

Gets the member list of the group. If no member is found from the server, the return might be empty.

Reference: You can get the group members in the following ways: (1) When member's number is less than 200, can use EMGroupManager#getGroupFromServer(String, boolean) to fetch, the second parameter pass in true, can get up to 200 members (2) Use the method of EMGroupManager#fetchGroupMembers(String, String, int) to get by page, or its asynchronous method of EMGroupManager#asyncFetchGroupMembers(String, String, int, EMValueCallBack)

to get

Returns
The list of the user IDs of the group members.

◆ getMuteList()

List< String > com.hyphenate.chat.EMGroup.getMuteList ( )

Gets the mute list of the group.

If no mute list is found from the server, the return may be empty.

Reference: You can also fetch the mute list by calling EMGroupManager#fetchGroupMuteList(String, int, int). And only the group owner or admin can call this method.

You can also call it's asynchronous method, see EMGroupManager#asyncFetchGroupMuteList(String, int, int, EMValueCallBack).

Returns
The mute list of the group.

◆ getOwner()

String com.hyphenate.chat.EMGroup.getOwner ( )

Gets the user ID of the group owner.

Returns
The user ID of the group owner.

◆ getShareFileList()

List< EMMucSharedFile > com.hyphenate.chat.EMGroup.getShareFileList ( )

Gets the group shared file list. If no shared file is found from the server, the return might be empty.

Reference: You can also call EMGroupManager#fetchGroupSharedFileList(String, int, int) to fetch the shared file list. And for the asynchronous method, see EMGroupManager#asyncFetchGroupSharedFileList(String, int, int, EMValueCallBack).

Returns
The group shared file list.

◆ getUsers()

List< String > com.hyphenate.chat.EMGroup.getUsers ( )

Gets all occupants of the group.

This includes the group owner, admins, and all other group members.

Returns
The list of the user IDs of all group occupants.

◆ getWhiteList()

List< String > com.hyphenate.chat.EMGroup.getWhiteList ( )

Gets the allowlist of the group.

If no allowlist is found from the server, the return may be empty.

Reference: You can also fetch the allowlist by calling EMGroupManager#fetchGroupWhiteList(String, EMValueCallBack). And only the group owner or admin can call this method.

Returns
The group allowlist.

◆ groupSubject()

String com.hyphenate.chat.EMGroup.groupSubject ( )

The name of the group. Be sure to fetch the detail specification of the group from the server first, see EMGroupManager#getGroupFromServer(String).

Returns
The group name.

◆ isAllMemberMuted()

boolean com.hyphenate.chat.EMGroup.isAllMemberMuted ( )

Gets whether all members are muted.

This method has limitations and is recommended to be used with caution.

The state is updated when a all-muted/all-unmuted callback is received, but only for the in-memory object. After the in-memory object is collected and pulled again from the database or server, the state becomes unreliable.

Returns
Whether all members are muted.

◆ isDisabled()

boolean com.hyphenate.chat.EMGroup.isDisabled ( )

Gets whether the group is disabled.

Returns
Whether the group is disabled:
  • true: Group has been disabled;
  • false: Group is not disabled.

◆ isJoinApprovalRequired()

boolean com.hyphenate.chat.EMGroup.isJoinApprovalRequired ( )

Gets the group config: whether joining a public group requires approval.

This method directly returns the value of the group config joinApprovalRequired. This config has no effect for private groups (isPublic=false), whose users can only join by invitation.

Returns
  • true: The group config joinApprovalRequired=true. Users need approval to join the public group.
  • false: The group config joinApprovalRequired=false. Users can join the public group freely.

◆ isMemberAllowToInvite()

boolean com.hyphenate.chat.EMGroup.isMemberAllowToInvite ( )

Gets whether the group member is allowed to invite other users to join the group.

Returns
Whether the group member is allowed to invite other users to join the group:
  • true: The group config allowInvites=true, and group members can invite other users to join the group;
  • false: The group config allowInvites=false, and group members can not invite other users to join the group.

◆ isMsgBlocked()

boolean com.hyphenate.chat.EMGroup.isMsgBlocked ( )

Gets whether the group message is blocked.

Reference: For blocking group message, see EMGroupManager#blockGroupMessage(String), unblocking see EMGroupManager#unblockGroupMessage(String)

Returns
- true: The user has blocked the group messages;
  • false: The user does not blocked the group messages.

◆ isPublic()

boolean com.hyphenate.chat.EMGroup.isPublic ( )

Gets whether the group is a public group.

Returns
true if the group config isPublic=true and the group is public; false if isPublic=false and the group is private.

◆ toString()

String com.hyphenate.chat.EMGroup.toString ( )

Gets the group name, or group ID if the group name is empty. This method can be used for adapter sorting.

Returns
The group name, or group ID if the group name is empty.

The documentation for this class was generated from the following file: