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

Create a merger message

Consolidate multiple existing messages into a single merged forward card message.

Copy

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

ParameterTypeRequiredDescription
messageListOpenIMMessageItem[]YesArray of existing message records to merge; array ordering determines display sequence.
titlestringYesTitle rendered on the merger preview card (for example, 'Chat History').
abstractListstring[]YesArray 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) return

Ensure 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.