Conversation

class Conversation(session: Session, name: String) : Emitter

Users are able to interact with each other by entering a conversation in a N-N fashion. The client is able to listen to conversation events that will be fired once the conversation is joined

Constructors

Link copied to clipboard
fun Conversation(session: Session, name: String)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class EventStreamHangup(    val from: String,     val reason: String,     val streamId: String)
Link copied to clipboard
data class Message(    val sender: Contact,     val content: String,     val time: Date = Date())

Group chat message

Link copied to clipboard
data class StreamInfo(    var listEventType: String,     val isRemote: Boolean,     val streamId: String,     val callId: String,     val type: String = "regular",     val name: String,     val callType: String,     val roomId: String,     val callerId: String)

Functions

Link copied to clipboard
fun cancelPushData(id: String)

Cancels an ongoing push data operation. Transfer can be resumed if apiKey, clientId, convId, filename and size are the same. Server allows resume for some time only

Link copied to clipboard
open fun emit(event: String, vararg args: Any): Emitter

Executes each of listeners with the given args.

Link copied to clipboard
fun getContacts(): ArrayList<Contact>

Returns contact list for conversation

Link copied to clipboard
fun getConversationCall(stream: Stream?): ConversationCall?

Returns the conversation call handle for a given stream.

Link copied to clipboard
fun getName(): String

Returns this conversation's room name

Link copied to clipboard
open fun hasListeners(event: String): Boolean

Check if this emitter has listeners for the specified event.

Link copied to clipboard
fun join(): Promise

Connects to a conversation if not already joined Once in the conversation, the user will be able to see other contacts inside it, send and receive messages, publish streams and subscribe to conversation's streams

Link copied to clipboard
fun joinGroupChat(): Promise

Joins group chat.

Link copied to clipboard
fun leave()

Leaves conversation The user will automatically stop publishing its streams to the conversation and stop subscribing to streams from the conversation. The user will no longer receive events from the conversation The user will no longer see who's within the conversation

Link copied to clipboard
fun leaveGroupChat(): Promise

Leaves group chat.

Link copied to clipboard
open fun listeners(event: String): MutableList<Emitter.Listener>

Returns a list of listeners for the specified event.

Link copied to clipboard
open fun off(): Emitter

Removes all registered listeners.

open fun off(event: String): Emitter

Removes all listeners of the specified event.

open fun off(event: String, fn: Emitter.Listener): Emitter

Removes the listener.

Link copied to clipboard
open fun on(event: String, fn: Emitter.Listener): Emitter

Listens on the event.

Link copied to clipboard
open fun once(event: String, fn: Emitter.Listener): Emitter

Adds a one time listener for the event.

Link copied to clipboard
fun publish(stream: Stream?)

Publish stream to conversation The stream will be able to be subscribed by other contacts within the conversation

Link copied to clipboard
fun pushData(data: Session.PushDataBufferDescriptor): Promise

Pushes data to this conversation

Link copied to clipboard
fun replacePublishedStream(newStream: Stream?, oldStream: Stream?)

Replaces the currently published stream by a given one.

Link copied to clipboard
fun sendMessage(message: String): Promise

Sends string message to contacts in conversation

Link copied to clipboard
fun subscribeToStream(streamId: String): Promise

Subscribes to a stream. The subscription will automatically stop if the contact publishing the stream unpublishes it. The Conversation#streamAdded event will be fired when the stream becomes available The Conversation#streamRemoved event will be fired when the stream is no longer available The Conversation#hangup event will be fired the subscription is terminated.

Link copied to clipboard
fun unpublish(stream: Stream?)

Unpublishes currently published stream to conversation If other users within the conversation subscribed to this stream, it will be stopped on their side