Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ConversationsManager

Hierarchy

  • ConversationsManager

Index

Properties

conversations

conversations: Collection<Conversation>

Here is a correct way to accept incoming IM invitations:

client.conversationsManager.conversations.added(conversation => {
    var chat = conversation.chatService;
    if (chat.accept.enabled())
        chat.accept();
});

The only way to remove a conversation from the collection is to invoke the remove method which stops the conversation and then removes it from the collection:

var cv = client.conversationsManager.conversations(5);
client.conversationsManager.conversations.remove(cv).catch(err => {
    console.log("Failed to remove the conversation: " + err);
});

If the conversation gets stopped because it was terminated on the remote side or because all participants left, the conversation object stays in the collection, but its state changes to "Disconnected".

To remove all conversations that get disconnected, use the following pattern:

client.conversationsManager.conversations.added(cv => {
    cv.state.once('Disconnected', () => {
        client.conversationsManager.conversations.remove(cv);
    });
});

isHistoryEnabled

isHistoryEnabled: Property<boolean> & { auto: Property<boolean>; }

Reflects the current state on ucwa regarding whether history is enabled. isHistoryEnabled can only be changed once the sdk is connected to the server and when rel=communication has an etag value. Once enabled, if set to false it disables history on ucwa and stops ucwa from auto accepting IMs.

Set isHistoryEnabled.auto to false after creating the app and before signing in if the app does not want the sdk to automatically enable conversation history.

Methods

createConversation

  • Creates a new multiparty conversation model.

    The created conversation model represents a new multiparty conversation (meeting). To start the conversation add participants (optionally) and start one of the conversation services. If no participants are added, the model represents a meeting that is joined by the local participant only. This method adds the created conversation to the conversations collection.

    var conversation = app.conversationsManager.createConversation();
    var remoteParty = conversation.createParticipant(remotePerson);
    conversation.participants.add(remoteParty);
    conversation.chatService.start().then(() => {
        console.log("chat started");
    });
    

    Returns Conversation

createMeeting

  • Schedules a meeting, but doesn't join it. To join ameeting, one can use getConversationByUri.

    Returns ScheduledMeeting

createSearchQuery

  • To search for conversations create the search query, set search terms on the query object and execute the query's search method.

    var searchQuery = client.conversationsManager.createSearchQuery(); searchQuery.text("scrum planning"); searchQuery.keywords['participant'] = 'frank'; searchQuery.getMore().then(() => { searchQuery.results().forEach((r) => { console.log("conversation uri:", r.result.id()); }); });

    Returns SearchQuery<Conversation>

getConversation

  • Finds an existing 1:1 conversation model or creates a new one.

    This method finds or creates a conversation with a given Person. Our API allows multiple 1:1 conversations with the same person, so while looking for an existing conversation we simply pick the first one found among such ongoing conversations. We ignore disconnected (ended) conversations that may still linger in the conversations collection. This method adds the newly created conversation to the conversations collection.

    Parameters

    Returns Conversation

  • This method finds or creates a conversation with a given SIP URI.

    Parameters

    • sipUri: string

    Returns Conversation

getConversationByUri

  • Finds an existing multiparty conversation model or creates a new one.

    A conversation uri has a meaning only for a multiparty conversation

    • it is a meeting uri. A conversation model with such a uri represents the client's view of this meeting. Note that initially such a model is just an empty conversation model which has a non-null uri property; the client joins the meeting only when one of the conversation services is started. This method adds the newly created conversation to the conversations collection.

    Parameters

    • uri: string

    Returns Conversation