Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Mark or unmark conversation

Set or clear the flagged marker on a conversation for the current user.

Copy

Marking a conversation automatically places it in the built-in marked filter group without requiring explicit conversation group management calls:

Code example

import sdk, { SetConversationReq } from '@openimsdk/imsdk';

const request: SetConversationReq = {
  conversationID: conversationID,
  isMarked: true,
};
await sdk.setConversation(request);

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation identifier.
isMarkedbooleanYesSet to true to flag the conversation; set to false to unflag.

Return value

Returns a Promise that resolves to void when the marked flag is saved.

State changes after the call

Marking and pinning are independent states. Once the Promise resolves, the SDK fires EventOnConversationChanged. Match the item by conversationID and update its isMarked boolean property in the UI, as documented in Retrieve conversation list.