Create a merger message
Consolidate multiple existing messages into a single merged forward card message.
Invoke createMergerMessage() to bundle multiple existing message records into a single merged forward card. Recipients typically see the card title and preview summary snippets in the chat view, tapping the card to review the full merged message timeline.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messageList | OpenIMMessageItem[] | Yes | Array of existing message records to merge; array ordering determines display sequence. |
title | string | Yes | Title rendered on the merger preview card (for example, 'Chat History'). |
abstractList | string[] | Yes | Array of summary preview lines generated from message content. |
Code example
import { createMergerMessage } from '@/uni_modules/unix-openim-sdk'
const message = await createMergerMessage({
messageList: selectedMessages,
title: 'Project Discussion History',
abstractList: [
'Alex: Please confirm deployment time',
'Morgan: Scheduled for Friday release',
],
})
if (message == null) returnEnsure messageList contains fully populated message records that were previously sent. The SDK does not automatically synthesize abstractList; compile preview lines in your application layer.
Return value
The Promise resolves with an OpenIMMessageItem | null object. Merging does not modify or delete the original source messages.
State changes after the call
Pass the constructed message item to Send a message. If you want each selected message to appear as a standalone forward item in the destination chat rather than a merged digest, use Create a forward message instead.
Was this page helpful?