Unity and Windows API reference
Public 成员函数 | 所有成员列表
ChatSDK.IChatThreadManager类 参考abstract

Public 成员函数

abstract void CreateThread (string threadName, string msgId, string groupId, ValueCallBack< ChatThread > handle=null)
 
abstract void JoinThread (string threadId, ValueCallBack< ChatThread > handle=null)
 
abstract void LeaveThread (string threadId, CallBack handle=null)
 
abstract void DestroyThread (string threadId, CallBack handle=null)
 
abstract void RemoveThreadMember (string threadId, string username, CallBack handle=null)
 
abstract void ChangeThreadName (string threadId, string newName, CallBack handle=null)
 
abstract void FetchThreadMembers (string threadId, string cursor=null, int pageSize=20, ValueCallBack< CursorResult< string > > handle=null)
 
abstract void FetchThreadListOfGroup (string groupId, bool joined, string cursor=null, int pageSize=20, ValueCallBack< CursorResult< ChatThread > > handle=null)
 
abstract void FetchMineJoinedThreadList (string cursor=null, int pageSize=20, ValueCallBack< CursorResult< ChatThread > > handle=null)
 
abstract void GetThreadDetail (string threadId, ValueCallBack< ChatThread > handle=null)
 
abstract void GetLastMessageAccordingThreads (List< string > threadIds, ValueCallBack< Dictionary< string, Message > > handle=null)
 
void AddThreadManagerDelegate (IChatThreadManagerDelegate threadManagerDelegate)
 
void RemoveThreadManagerDelegate (IChatThreadManagerDelegate threadManagerDelegate)
 

成员函数说明

◆ CreateThread()

abstract void ChatSDK.IChatThreadManager.CreateThread ( string  threadName,
string  msgId,
string  groupId,
ValueCallBack< ChatThread handle = null 
)
pure virtual

创建子区。

子区所属群组的所有成员均可调用该方法。

子区创建成功后,会出现如下情况:

参数
threadName要创建的子区的名称。长度不超过 64 个字符。
msgId父消息 ID。
groupId父 ID,即群组 ID。
handle结果回调:

◆ JoinThread()

abstract void ChatSDK.IChatThreadManager.JoinThread ( string  threadId,
ValueCallBack< ChatThread handle = null 
)
pure virtual

加入子区。

子区所属群组的所有成员均可调用该方法。

多端多设备登录时,注意以下几点:

参数
threadId子区 ID。
handle结果回调:

◆ LeaveThread()

abstract void ChatSDK.IChatThreadManager.LeaveThread ( string  threadId,
CallBack  handle = null 
)
pure virtual

退出子区。

子区中的所有成员均可调用该方法。

多设备登录情况下,注意以下几点:

参数
threadId要退出的子区的 ID。
handle结果回调:

◆ DestroyThread()

abstract void ChatSDK.IChatThreadManager.DestroyThread ( string  threadId,
CallBack  handle = null 
)
pure virtual

解散子区。

只有子区所属群组的群主及管理员可调用该方法。

注意

参数
threadId子区 ID。
handle结果回调:

◆ RemoveThreadMember()

abstract void ChatSDK.IChatThreadManager.RemoveThreadMember ( string  threadId,
string  username,
CallBack  handle = null 
)
pure virtual

移除子区成员。

只有子区所属群主、群管理员及子区创建者可调用该方法。

被移出的成员会收到 IChatThreadManagerDelegate#OnUserKickOutOfChatThread(ChatThreadEvent) 回调。

你可通过设置 IChatThreadManagerDelegate 监听子区事件。

参数
threadId子区 ID。
username被移出子区的成员的用户 ID。
handle结果回调。

◆ ChangeThreadName()

abstract void ChatSDK.IChatThreadManager.ChangeThreadName ( string  threadId,
string  newName,
CallBack  handle = null 
)
pure virtual

修改子区名称。

只有子区所属群主、群管理员及子区创建者可调用该方法。

子区所属群组的成员会收到 IChatThreadManagerDelegate#OnChatThreadUpdate(ChatThreadEvent) 回调。

你可通过设置 IChatThreadManagerDelegate 监听子区事件。

参数
threadId子区 ID。
newName子区的新名称。长度不超过 64 个字符。
handle结果回调:

◆ FetchThreadMembers()

abstract void ChatSDK.IChatThreadManager.FetchThreadMembers ( string  threadId,
string  cursor = null,
int  pageSize = 20,
ValueCallBack< CursorResult< string > >  handle = null 
)
pure virtual

分页获取子区成员。

子区所属群组的所有成员均可调用该方法。

参数
threadId子区 ID。
cursor开始获取数据的游标位置,首次调用方法时传 null 或空字符串,按成员加入子区时间的正序获取数据。
pageSize每页期望返回的成员数。取值范围为 [1,50]。
callBack结果回调:

Gets a list of members in the message thread with pagination.

Each member of the group to which the message thread belongs can call this method.

参数
threadIdThe message thread ID.
cursorThe position from which to start getting data. At the first method call, if you set cursor to null or an empty string, the SDK will get data in the chronological order of when members join the message thread.
pageSizeThe number of members that you expect to get on each page. The value range is [1,50].
callBackThe result callback:

◆ FetchThreadListOfGroup()

abstract void ChatSDK.IChatThreadManager.FetchThreadListOfGroup ( string  groupId,
bool  joined,
string  cursor = null,
int  pageSize = 20,
ValueCallBack< CursorResult< ChatThread > >  handle = null 
)
pure virtual

分页从服务器端获取指定群组的子区列表。

参数
groupId父 ID,即群组 ID。
joined是否是当前用户加入的子区。
cursor开始取数据的游标位置。首次获取数据时传 null 或空字符串,按子区创建时间的倒序获取数据。
pageSize每页期望返回的子区数。取值范围为 [1,50]。
callBack结果回调:

◆ FetchMineJoinedThreadList()

abstract void ChatSDK.IChatThreadManager.FetchMineJoinedThreadList ( string  cursor = null,
int  pageSize = 20,
ValueCallBack< CursorResult< ChatThread > >  handle = null 
)
pure virtual

分页从服务器获取当前用户加入的子区列表。

参数
cursor开始获取数据的游标位置。首次调用方法时传 null 或空字符串,按用户加入子区时间的倒序获取数据。
pageSize每页期望返回的子区数。取值范围为 [1,50]。
callBack结果回调:

◆ GetThreadDetail()

abstract void ChatSDK.IChatThreadManager.GetThreadDetail ( string  threadId,
ValueCallBack< ChatThread handle = null 
)
pure virtual

从服务器获取子区详情。

参数
threadId子区 ID。
handle结果回调:

◆ GetLastMessageAccordingThreads()

abstract void ChatSDK.IChatThreadManager.GetLastMessageAccordingThreads ( List< string >  threadIds,
ValueCallBack< Dictionary< string, Message > >  handle = null 
)
pure virtual

从服务器批量获取指定子区中的最新一条消息。

参数
threadIds要查询的子区 ID 列表,每次最多可传 20 个子区。
handle结果回调:

Gets the last reply in the specified message threads from the server.

参数
threadIdsThe list of message thread IDs to query. You can pass a maximum of 20 message thread IDs each time.
handleThe result callback:

◆ AddThreadManagerDelegate()

void ChatSDK.IChatThreadManager.AddThreadManagerDelegate ( IChatThreadManagerDelegate  threadManagerDelegate)

注册子区事件监听器,用于监听子区变化,如子区的创建和解散等。

你可以调用 RemoveThreadManagerDelegate 移除不需要的监听器。

参数
threadManagerDelegate要注册的子区事件监听器。

◆ RemoveThreadManagerDelegate()

void ChatSDK.IChatThreadManager.RemoveThreadManagerDelegate ( IChatThreadManagerDelegate  threadManagerDelegate)

移除子区事件监听器。

在利用 AddThreadManagerDelegate 注册子区事件监听器后调用此方法。

参数
listener要移除的子区事件监听器。