SDKsAndroid
Create a merged message
Use createMergerMessage to combine multiple messages into one summary message.
Combine multiple historical messages into a single merged forward card message. The resulting message displays as a preview card with a title and summary lines in the chat stream, which recipients can tap to expand and view the full conversation history.
Code example
List<Message> messages = Arrays.asList(msg1, msg2, msg3);
String title = "Chat history from Project Team";
List<String> summaries = Arrays.asList("Alex: We deployed the latest release", "Bob: Understood, running verification tests");
Message message = OpenIMClient.getInstance().messageManager.createMergerMessage(
messages,
title,
summaries
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | List<Message> | Yes | The list of original messages to bundle, ordered chronologically. |
title | String | Yes | Title displayed on the merged message card (such as "Chat history from Project Team"). |
summaries | List<String> | Yes | Summary preview lines displayed on the card (typically formatted as "Sender: Message snippet"). |
Return value
Returns the created Message object with contentType set to MessageType.MERGER.
State changes after the call
- Local initialization: Initializes the local
Messagestructure without sending data to the server. - Transmission: Call Send a message to deliver the merged message to a single user or group.
Was this page helpful?