SDKsWASM
Set conversation message reception
Set message reception and notification behavior for one conversation.
recvMsgOpt applies only to the selected conversation. Use it to implement conversation-level do not disturb.
import { MessageReceiveOption } from '@openim/wasm-client-sdk';
await openimsdk.setConversation({
conversationID,
recvMsgOpt: MessageReceiveOption.ReceiveWithoutNotification,
});Parameters
| Enum value | Numeric value | Meaning |
|---|---|---|
MessageReceiveOption.Receive | 0 | Receive messages normally and allow notifications. |
MessageReceiveOption.ReceiveWithoutNotification | 2 | Receive messages from this conversation without notifying. |
The account-wide default message receiving policy is controlled by globalRecvMsgOpt; see Set global message reception for details.
After the API call resolves, the SDK emits SdkEvent.OnConversationChanged to notify the policy update. Use conversationID to update the matching conversation's reception settings and do-not-disturb status in your client state. For complete event listener configuration, see Retrieve the conversation list.
Was this page helpful?