Browse SDKs · uni-app / uni-app x
SDKsuni-app

Hide a conversation

OpenIM uni-app / uni-app x SDK guide for Hide a conversation.

Copy

hideConversation() removes one conversation from the current account's visible list without deleting its messages.

import { hideConversation } from '@/uni_modules/unix-openim-sdk'

await hideConversation(conversationID)

This affects only the signed-in user's conversation entry. It does not remove a one-to-one relationship, leave a group, or change another user's state. A later incoming message or synchronization can make the conversation visible again. Use the explicit deletion API when messages should also be cleared, and explain the distinction in the UI.

State after the call

Promise success means that the hide request completed. The caller can remove the item from the current list by conversationID, but must still merge onConversationChanged or requery to reconcile. Do not update only a page array while leaving the conversation store unchanged; restore or update the original key if the conversation reappears.