Documentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
Edit a Message
UseeditMessage() with a TextMessage or CustomMessage object. Set the message ID using setId().
Add/Update Tags
While editing a message, you can update the tags associated with the Message. You can use thesetTags() method to do so. The tags added while editing a message will replace the tags set when the message was sent.
- Java
- Kotlin
editMessage().
- Java
- Kotlin
onSucess() callback method of the listener. The message object will contain the editedAt field set with the timestamp of the time the message was edited. This will help you identify if the message was edited while iterating through the list of messages. The editedBy field is also set to the UID of the user who edited the message.
| Field | Getter | Return Type | Description |
|---|---|---|---|
| editedAt | getEditedAt() | long | Timestamp when the message was edited |
| editedBy | getEditedBy() | String | UID of the user who edited the message |
| User Role | Conversation Type | Edit Capabilities |
|---|---|---|
| Message Sender | One-on-one Conversation | Messages they’ve sent |
| Message Sender | Group Conversation | Messages they’ve sent |
| Group Owner | Group Conversation | All messages in the group |
| Group Moderator | Group Conversation | All messages in the group |
Real-time Message Edit Events
UseonMessageEdited in MessageListener to receive real-time edit events.
- Java
- Kotlin
| Field | Getter | Return Type | Description |
|---|---|---|---|
| editedAt | getEditedAt() | long | Timestamp when the message was edited |
| editedBy | getEditedBy() | String | UID of the user who edited the message |
Missed Message Edit Events
When fetching message history, edited messages haveeditedAt and editedBy fields set. Additionally, an Action message is created when a message is edited.
For the message edited event, in the Action object received, the following fields can help you get the relevant information-
action-editedactionOn- Updated message object with the edited details.actionBy- User object containing the details of the user who has edited the message.actionFor- User/group object having the details of the receiver to which the message was sent.
In order to edit a message, you need to be either the sender of the message or the admin/moderator of the group in which the message was sent.
Next Steps
Delete Message
Remove messages from conversations
Send Message
Send text, media, and custom messages
Receive Messages
Handle real-time message events with listeners
Message Structure
Understand message types and properties