SDKsAndroid
Create a rich-text reply
Use createAdvancedQuoteMessage to create a quoted reply with rich-text entities.
Construct an advanced quoted reply message combining structured rich-text entities with a reference to a previous message. The reply body can include hyperlinks, mentions, and custom tags while displaying the quoted message's context.
Code example
RichMessage mention = new RichMessage();
mention.setType("mention");
mention.setOffset(0);
mention.setLength(6);
mention.setInfo("{\"userID\":\"user_a\"}");
Message message = OpenIMClient.getInstance().messageManager.createAdvancedQuoteMessage(
"OpenIM proposal approved",
originalMessage,
Collections.singletonList(mention)
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | String | Yes | Text content of the reply message. |
message | Message | Yes | The complete historical Message object being referenced. |
richMessages | List<RichMessage> | Yes | List of structured rich-text entities within the reply text. See Create a rich-text message for details. |
Return value
Returns the created Message object ready for transmission.
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 advanced quote message to a single user or group.
Was this page helpful?