chat.markConversation(options);
Name | Type | Description |
conversationIDList | String | 会话 ID 列表 |
markType | String | 会话标记类型 |
enableMark | Boolean | true 设置标记 false 取消标记 |
Promise
// 会话标星let promise = chat.markConversation({conversationIDList: ['GROUPtest', 'C2Cexample'],markType: TencentCloudChat.TYPES.CONV_MARK_TYPE_STAR,enableMark: true});promise.then(function(imResponse) {// 会话标星成功const { successConversationIDList, failureConversationIDList } = imResponse.data;// successConversationIDList - 标星成功的会话 ID 列表// 获取会话列表const conversationList = TencentCloudChat.getConversationList(successConversationIDList);// failureConversationIDList - 标星失败的会话 ID 列表failureConversationIDList.forEach((item) => {const { conversationID, code, message } = item;});}).catch(function(imError) {console.warn('markConversation error:', imError);});
let onConversationListUpdated = function(event) {console.log(event.data); // 包含 Conversation 实例的数组};tim.on(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED, onConversationListUpdated);
// 获取所有的“标星”会话let promise = chat.getConversationList({ markType: TencentCloudChat.TYPES.CONV_MARK_TYPE_STAR });promise.then(function(imResponse) {const conversationList = imResponse.data.conversationList; // 会话列表});
// 获取所有折叠的 C2C 会话let promise = chat.getConversationList({markType: TencentCloudChat.TYPES.CONV_MARK_TYPE_FOLD,type: TencentCloudChat.TYPES.CONV_C2C});promise.then(function(imResponse) {const conversationList = imResponse.data.conversationList; // 会话列表});
本页内容是否解决了您的问题?