Set message destruct
Enable, disable, and configure server-side scheduled message destruction using the OpenIM Flutter SDK.
Enable or disable scheduled automatic message destruction on the server and configure the retention duration. This feature governs server-side message retention lifecycles and operates independently from client-side read-burn capabilities:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | Target conversation ID. |
req | ConversationReq | Yes | Conversation modification request object. Set isMsgDestruct to toggle scheduled destruction, and msgDestructTime to define the retention duration in seconds (for example, 3600 for 1 hour). |
Code example
await OpenIM.iMManager.conversationManager.setConversation(
conversationID,
ConversationReq(
isMsgDestruct: true,
msgDestructTime: 3600,
),
);Return value
A successful Future indicates that the scheduled destruction policy has been configured on the server. To disable this feature, set isMsgDestruct to false.
State changes after the call
Multi-device synchronization and arriving changes trigger conversation change events. The client uses conversationID as the merge key to update destruction settings on the local conversation model. For complete listener integration, see Retrieve conversation list.
Was this page helpful?