SIGN UP
Navigation

IConversation

Interface that may be used to manage conversation.

Methods

void addModerators(List<String> moderators)

Add new moderators to the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

Parameters

  • moderators:

    List<String>

    List of moderators to be added to the conversation

void addParticipants(List<ConversationParticipant> participants)

Add new participants to the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

Parameters

void editParticipants(List<ConversationParticipant> participants)

Edit participants' access rights. Duplicated users are ignored. Participant list must contain all participants. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

Parameters

long getCreatedTime()

Get UNIX timestamp that specifies the time of the conversation creation.

Returns

  • Return:

    long

    UNIX timestamp

Map<Object,Object> getCustomData()

Get object with custom data, up to 5kb.

Returns

  • Return:

    Map<Object,Object>

    Custom data of the conversation

long getLastRead()

Get sequence of last event that was read by user. Used to display unread messages, events etc.

Returns

  • Return:

    long

    Sequence of last event that was read by user

long getLastSequence()

Returns sequence of last event that was read by user.

Returns

  • Return:

    long

    Sequence of last event that was read by user

long getLastUpdateTime()

Get UNIX timestamp that specifies the time of the last event in the conversation.

Returns

  • Return:

    long

    UNIX timestamp

List<String> getModerators()

Get conversation moderator names list.

Returns

  • Return:

    List<String>

    Conversation moderator names list

List<ConversationParticipant> getParticipants()

Get conversation participants list alongside with their rights.

Returns

String getTitle()

Get current conversation title.

Returns

  • Return:

    String

    The conversation title

String getUUID()

Get universally unique identifier of current conversation.

Returns

  • Return:

    String

    UUID of the conversation

boolean isDistinct()

Check if the conversation is distinct. If two conversations are created with same set of users and moderators and both have 'distinct' flag, second create call will fail with the UUID of conversation already created. Note that changing users or moderators list will clear 'distinct' flag.

Returns

  • Return:

    boolean

    True if the conversation is distinct, false otherwise

boolean isPublicJoin()

Check if public join is enabled. If set to true, anyone can join conversation by UUID.

Returns

  • Return:

    boolean

    True if piblic join is enabled, false otherwise

boolean isUberConversation()

Check if the conversation is uber conversation.

Returns

  • Return:

    boolean

    True if the conversation is uber conversation, false otherwise

void markAsDelivered(long sequence)

Mark event with the specified sequence as handled by current logged-in device. If single user is logged in on multiple devices, this can be used to display delivery status

Parameters

  • sequence:

    long

    Sequence number of the event to be marked as delivered

void markAsRead(long sequence)

Mark the event with the specified sequence as 'read'. This affects 'lastRead' and is used to display unread messages and events.

Parameters

  • sequence:

    long

    Sequence number of the event to be marked as read

void remove()

Remove current conversation. All participants, including this one, will receive the IMessengerListener.onRemoveConversation(IConversationEvent) event.

void removeModerators(List<String> moderators)

Remove moderators from the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

Parameters

  • moderators:

    List<String>

    List of moderators to be removed from the conversation

void removeParticipants(List<ConversationParticipant> participants)

Remove participants from the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

Parameters

void retransmitEvents(long eventsFrom, long eventsTo)

Request events in the specified sequence range to be sent from server into this client. Used to get history or get missed events in case of network disconnect. Please note that server will not push any events that was missed due to the client being offline. Client should use this method to request all events based on the last event sequence received from the server and last event sequence saved locally (if any).

Parameters

  • eventsFrom:

    long

    First event in range sequence, inclusive

  • eventsTo:

    long

    Last event in range sequence, inclusive

IMessage sendMessage(String text, List<Payload> payload)

Send message to the conversation. Triggers the IMessengerListener.onSendMessage(IMessageEvent) event for all messenger objects on all clients, including this one.

Parameters

  • text:

    String

    Message text

  • payload:

    List<Payload>

    Message payload

Returns

void setCustomData(Map<Object,Object> customData)

Set new custom data for the conversation. Note that setting this property does not send changes to the server. Use the IConversation.update() to send all changes at once

Parameters

  • customData:

    Map<Object,Object>

    Custom data of the conversation

void setDistinct(boolean distinct)

Set distinct property of the conversation. Note that changing users or moderators list will clear 'distinct' flag of the conversation. Note that setting this property does not send changes to the server. Use the IConversation.update() to send all changes at once

Parameters

  • distinct:

    boolean

    If two conversations are created with same set of users and moderators and both have 'distinct' flag, second create call will fail with the UUID of conversation already created.

void setPublicJoin(boolean publicJoin)

Set public join property of the conversation. Note that setting this property does not send changes to the server. Use the IConversation.update() to send all changes at once

Parameters

  • publicJoin:

    boolean

    If set to 'true', anyone can join conversation by UUID

void setTitle(String title)

Set current conversation title. Note that setting this property does not send changes to the server. Use the 'update' to send all changes at once.

Parameters

  • title:

    String

    New conversation title

boolean typing()

Calling this method will inform backend that user is typing some text. Calls within 10s interval from the last call are discarded.

Returns

  • Return:

    boolean

    True is message was actually sent, false if it was discarded

void update()

Send conversation changes to the server. The changes sent are: title, public join flag, distinct flag and custom data.