Conversation

interface Conversation

Container for conversation object.

To obtain a Conversation call createConversation, getConversation or get it from collections returned by getMyConversations.

Conversation is a relatively heavy-weight object. It receives state updates from the back-end in real time.

Types

ConversationState
Link copied to clipboard
enum ConversationState
Represents the various states of the conversation.
ConversationStatus
Link copied to clipboard
enum ConversationStatus
Represents the various statuses of the user with respect to the conversation.
MessageBuilder
Link copied to clipboard
interface MessageBuilder
Builder for preparing new message.
NotificationLevel
Link copied to clipboard
enum NotificationLevel
User's notification level on a conversation.
SynchronizationStatus
Link copied to clipboard
enum SynchronizationStatus
Indicates synchronization status for conversation.
UnsentMessage
Link copied to clipboard
interface UnsentMessage
Unsent message which is ready for sending.
UpdateReason
Link copied to clipboard
enum UpdateReason
Indicates reason for conversation update.

Functions

addListener
Link copied to clipboard
abstract fun addListener(listener: ConversationListener)
Add a new ConversationListener for this Conversation.
addParticipantByAddress
Link copied to clipboard
abstract fun addParticipantByAddress(address: String, proxyAddress: String, attributes: Attributes, listener: StatusListener)
Add specified non chat participant to this conversation (sms, whatsapp participants etc).
addParticipantByIdentity
Link copied to clipboard
abstract fun addParticipantByIdentity(identity: String, attributes: Attributes, listener: StatusListener)
Add the participant with the specified username to this conversation.
advanceLastReadMessageIndex
Link copied to clipboard
abstract fun advanceLastReadMessageIndex(lastReadMessageIndex: Long, listener: CallbackListener<Long>)
Increase user last read message index for the conversation.
destroy
Link copied to clipboard
abstract fun destroy(listener: StatusListener)
Destroy the current conversation.
getAttributes
Link copied to clipboard
abstract fun getAttributes(): Attributes
Get custom attributes associated with the Conversation.
getCreatedBy
Link copied to clipboard
abstract fun getCreatedBy(): String
Get creator of the conversation.
getDateCreated
Link copied to clipboard
abstract fun getDateCreated(): String
Get creation date of the conversation as an ISO 8601 string.
getDateCreatedAsDate
Link copied to clipboard
abstract fun getDateCreatedAsDate(): Date
Get creation date of the conversation.
getDateUpdated
Link copied to clipboard
abstract fun getDateUpdated(): String
Get update date of the conversation as an ISO 8601 string.
getDateUpdatedAsDate
Link copied to clipboard
abstract fun getDateUpdatedAsDate(): Date
Get update date of the conversation.
getFriendlyName
Link copied to clipboard
abstract fun getFriendlyName(): String
Get friendly name of the conversation.
getLastMessageDate
Link copied to clipboard
abstract fun getLastMessageDate(): Date
Get last message date in the conversation.
getLastMessageIndex
Link copied to clipboard
abstract fun getLastMessageIndex(): Long
Get last message's index in the conversation.
getLastMessages
Link copied to clipboard
abstract fun getLastMessages(count: Int, listener: CallbackListener<List<Message>>)
Load last messages in conversation.
getLastReadMessageIndex
Link copied to clipboard
abstract fun getLastReadMessageIndex(): Long
Return user last read message index for the conversation.
getLimits
Link copied to clipboard
abstract fun getLimits(): ConversationLimits
getMessageByIndex
Link copied to clipboard
abstract fun getMessageByIndex(index: Long, listener: CallbackListener<Message>)
Get message object by known index.
getMessagesAfter
Link copied to clipboard
abstract fun getMessagesAfter(index: Long, count: Int, listener: CallbackListener<List<Message>>)
Fetch at most count messages including and subsequent to the specified index.
getMessagesBefore
Link copied to clipboard
abstract fun getMessagesBefore(index: Long, count: Int, listener: CallbackListener<List<Message>>)
Fetch at most count messages including and prior to the specified index.
getMessagesCount
Link copied to clipboard
abstract fun getMessagesCount(listener: CallbackListener<Long>)
Get total number of messages in the conversation.
getNotificationLevel
Link copied to clipboard
abstract fun getNotificationLevel(): Conversation.NotificationLevel
The current user's notification level on this conversation.
getParticipantByIdentity
Link copied to clipboard
abstract fun getParticipantByIdentity(identity: String): Participant
Get a conversation participant by identity.
getParticipantBySid
Link copied to clipboard
abstract fun getParticipantBySid(sid: String): Participant
Get a conversation participant by sid.
getParticipantsCount
Link copied to clipboard
abstract fun getParticipantsCount(listener: CallbackListener<Long>)
Get total number of participants in the conversation roster.
getParticipantsList
Link copied to clipboard
abstract fun getParticipantsList(): List<Participant>
Obtain an array of participants of this conversation.
getSid
Link copied to clipboard
abstract fun getSid(): String
Get unique identifier for this conversation.
getState
Link copied to clipboard
abstract fun getState(): Conversation.ConversationState
Get activity state of this conversation.
getStateDateUpdatedAsDate
Link copied to clipboard
abstract fun getStateDateUpdatedAsDate(): Date
Get update date of the ConversationState
getStatus
Link copied to clipboard
abstract fun getStatus(): Conversation.ConversationStatus
Get the current user's participation status on this conversation.
getSynchronizationStatus
Link copied to clipboard
abstract fun getSynchronizationStatus(): Conversation.SynchronizationStatus
Get the current synchronization status for conversation.
getUniqueName
Link copied to clipboard
abstract fun getUniqueName(): String
Get unique name of the conversation.
getUnreadMessagesCount
Link copied to clipboard
abstract fun getUnreadMessagesCount(listener: CallbackListener<Long>)
Get number of unread messages in the conversation.
join
Link copied to clipboard
abstract fun join(listener: StatusListener)
Join the current user to this conversation.
leave
Link copied to clipboard
abstract fun leave(listener: StatusListener)
Leave this conversation.
prepareMessage
Link copied to clipboard
abstract fun prepareMessage(): Conversation.MessageBuilder
Prepares a new message to send into the conversation.
removeAllListeners
Link copied to clipboard
abstract fun removeAllListeners()
Remove all ConversationListeners for this Conversation.
removeListener
Link copied to clipboard
abstract fun removeListener(listener: ConversationListener)
Remove ConversationListener for this Conversation.
removeMessage
Link copied to clipboard
abstract fun removeMessage(message: Message, listener: StatusListener)
Removes a message from the conversation.
removeParticipant
Link copied to clipboard
abstract fun removeParticipant(participant: Participant, listener: StatusListener)
Remove specified participant from this conversation.
removeParticipantByIdentity
Link copied to clipboard
abstract fun removeParticipantByIdentity(identity: String, listener: StatusListener)
Remove the participant with the specified identity from this conversation.
setAllMessagesRead
Link copied to clipboard
abstract fun setAllMessagesRead(listener: CallbackListener<Long>)
Mark all messages in conversation as read.
setAllMessagesUnread
Link copied to clipboard
abstract fun setAllMessagesUnread(listener: CallbackListener<Long>)
Mark all messages in conversation as unread.
setAttributes
Link copied to clipboard
abstract fun setAttributes(attributes: Attributes, listener: StatusListener)
Set attributes associated with this conversation.
setFriendlyName
Link copied to clipboard
abstract fun setFriendlyName(friendlyName: String, listener: StatusListener)
Update the friendly name for this conversation.
setLastReadMessageIndex
Link copied to clipboard
abstract fun setLastReadMessageIndex(lastReadMessageIndex: Long, listener: CallbackListener<Long>)
Set user last read message index for the conversation.
setNotificationLevel
Link copied to clipboard
abstract fun setNotificationLevel(notificationLevel: Conversation.NotificationLevel, listener: StatusListener)
Set the user's notification level for the conversation.
setUniqueName
Link copied to clipboard
abstract fun setUniqueName(uniqueName: String, listener: StatusListener)
Update the unique name for this conversation.
typing
Link copied to clipboard
abstract fun typing()
Indicate that Participant is typing in this conversation.