Options
Menu

Class DirectChat

A DirectChat represents a Chat construct that is defined by a specific set of users. The communication for a given DirectChat will always be between the specified set of users. This can not change for the life of the DirectChat.

Hierarchy

Index

Properties

StaticEvents

Events: ChatEvents = Events

Methods

addListener

events

  • Provides the events emitted by this object as an Observable stream.

    example
    
    eventEmitter.events()
      .filter(e => e.name === "myevent")
      .subscribe(e => console.log(e));

    Returns Observable<IChatEvent>

    An Observable stream of all events emitted by this object.

getHistory

  • Get the history of events for this Chat. Events consist of messages, users joining / leaving, and a variety of other events depending on the chat type.

    Parameters

    Returns Promise<PagedData<ChatHistoryEntry>>

    A promise that will be resolved with an array of Chat events that match the specified search options.

info

isJoined

  • isJoined(): boolean
  • Determines if the Chat is Joined. Chat's must be joined to perform many functions, such as sending messages.

    Returns boolean

    True if the chat is joined, false otherwise.

markSeen

  • markSeen(eventNumber: number): Promise<void>
  • Marks the specified event number as having been seen by the local user. It is assumed that all events prior or equal to this event have been seen by the user.

    Parameters

    • eventNumber: number

      The event number to mark as set.

    Returns Promise<void>

    A promise acknowledging that seen events have been marked successfully.

off

on

once

  • Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.

    Parameters

    Returns ConvergenceEventEmitter<IChatEvent>

    This object, in support of a fluent API.

removeAllListeners

removeListener

removeListeners

send

  • Publishes a chat message to this Chat.

    Parameters

    • message: string

      The message to send.

    Returns Promise<IChatMessageResponse>

    A promise acknowledging that the message has been received by the server.

session

setName

  • setName(name: string): Promise<void>
  • Sets the short descriptive name for this chat.

    Parameters

    • name: string

      The name to set.

    Returns Promise<void>

    A promise acknowledging that the name has been successfully set.

setTopic

  • setTopic(topic: string): Promise<void>
  • Sets the the current topic being discussed in the chat.

    Parameters

    • topic: string

      The topic to set.

    Returns Promise<void>

    A promise acknowledging that the topic has been successfully set.