SIGN UP

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

  • Return:

    String

    Conversation UUID

getPayload

List<Map<String,Object>> getPayload()

Get the list of payload objects associated with the message.

Returns

  • Return:

    List<Map<String,Object>>

getSequence

long getSequence()

Get the message sequence number in the conversation.

Returns

  • Return:

    long

    Message sequence number

getText

String getText()

Get the text of this message.

Returns

  • Return:

    String

    Message text

getUUID

String getUUID()

Get the universally unique identifier (UUID) of the message.

Returns

  • Return:

    String

    UUID of this message

remove

void remove(IMessengerCompletionHandler<IMessageEvent> handler)

Remove the message from the conversation.

The participant that calls this method should have:

To get the method call result use one of the following options:

  1. Specify the handler parameter to consume the results with IMessageEvent or IErrorEvent in case of success/error accordingly.
  2. 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

update

void update(String text, List<Map<String,Object>> payload, IMessengerCompletionHandler<IMessageEvent> handler)

Send text and payload changes to the cloud.

The participant that calls this method should have:

To get the method call result use one of the following options:

  1. Specify the handler parameter to consume the results with IMessageEvent or IErrorEvent in case of success/error accordingly.
  2. 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.

  • Completion handler to get the result or null