IMessage
Interface that represents a message within a conversation.
Methods
getConversation
String
getConversation()
Get the UUID of the conversation this message belongs to.
The message can belong to the one conversation only.
Returns
type:
String
getPayload
List<Map<String, Object>>
getPayload()
Get the list of payload objects associated with the message.
Returns
type:
List<Map<String, Object>>
getSequence
long
getSequence()
Get the message sequence number in the conversation.
Returns
type:
long
getText
String
getText()
Get the text of this message.
Returns
type:
String
getUUID
String
getUUID()
Get the universally unique identifier (UUID) of the message.
Returns
type:
String
remove
void
remove( handler)
Remove the message from the conversation.
The participant that calls this method should have:
- the ConversationParticipant.canRemoveMessages() permission to remove its own messages
- the ConversationParticipant.canRemoveAllMessages() permission to remove other participants' messages
To get the method call result use one of the following options:
- Specify the handler parameter to consume the results with IMessageEvent or IErrorEvent in case of success/error accordingly.
- Implement the IMessengerListener.onRemoveMessage(IMessageEvent) and IMessengerListener.onError(IErrorEvent) events.
Other parties of the conversation (online participants and logged in clients) can be informed about the message removing via the IMessengerListener.onRemoveMessage(IMessageEvent) event.
Parameters
handler:
Completion handler to get the result or null
Returns
type:
void
update
void
update(String
text, List<Map<String, Object>>
payload, handler)
Send text and payload changes to the cloud.
The participant that calls this method should have:
- the ConversationParticipant.canEditMessages() permission to update its own messages
- the ConversationParticipant.canEditAllMessages() permission to update other participants' messages
To get the method call result use one of the following options:
- Specify the handler parameter to consume the results with IMessageEvent or IErrorEvent in case of success/error accordingly.
- Implement the IMessengerListener.onEditMessage(IMessageEvent) and IMessengerListener.onError(IErrorEvent) events.
Other parties of the conversation (online participants and logged in clients) can be informed about the message updating via the IMessengerListener.onEditMessage(IMessageEvent) event.
To be informed about the message updating while being offline, participants can subscribe to the MessengerNotification.ON_EDIT_MESSAGE messenger push notification.
Parameters
text:
String
New text of this message, maximum 5000 characters. If null, message text will not be updated.
payload:
List<Map<String, Object>>
New payload of this message. If null, message payload will not be updated.
handler:
Completion handler to get the result or null
Returns
type:
void