Home Manual Reference Source
import Invite from 'webcom-reach/src/core/Invite.js'
public class | source

Invite

Invitation

Member Summary

Public Members
public

Invite's sender uid

public get

Was this invitation accepted ?

public get

Was this invitation canceled ?

public get

Is this invitation waiting for a reply ?

public get

Was this invitation rejected ?

public

The id of the room associated to the invite

public

The invitation status :

  • ONGOING - The receiver has not yet responded to the invitation
  • ACCEPTED - The receiver has accepted the invitation
  • REJECTED - The receiver has rejected the invitation
  • CANCELED - The sender canceled the invitation
public

Invitee's uid

public

Invite message.

public

uid: *

Invite's unique id

Method Summary

Public Methods
public

Accept the invitation.

public

Cancels the invitation.

public

off(status: string, callback: function)

Un-register a callback for a status update

public

Un-register a callback for all status change events

public

on(status: string, callback: function)

Register a callback for a status update

public

Register a callback for all status change events

public

Rejects the invitation.

Public Members

public from: string source

Invite's sender uid

public get isAccepted: boolean source

Was this invitation accepted ?

public get isCanceled: boolean source

Was this invitation canceled ?

public get isOnGoing: boolean source

Is this invitation waiting for a reply ?

public get isRejected: boolean source

Was this invitation rejected ?

public room: string source

The id of the room associated to the invite

public status: string source

The invitation status :

  • ONGOING - The receiver has not yet responded to the invitation
  • ACCEPTED - The receiver has accepted the invitation
  • REJECTED - The receiver has rejected the invitation
  • CANCELED - The sender canceled the invitation

public to: string source

Invitee's uid

public topic: string source

Invite message. This will be either a custom message if the status is ONGOING or a reason when status is CANCELED|REJECTED.

public uid: * source

Invite's unique id

Public Methods

public accept(): Promise<Invite> source

Accept the invitation. Only the receiver can accept the invitation.

Return:

Promise<Invite>

public cancel(reason: string): Promise<Invite> source

Cancels the invitation. Only the sender can cancel the invitation.

Params:

NameTypeAttributeDescription
reason string
  • optional

The reason the sender is canceling the invite

Return:

Promise<Invite>

public off(status: string, callback: function) source

Un-register a callback for a status update

Params:

NameTypeAttributeDescription
status string
  • optional

Can be:

  • ACCEPTED
  • REJECTED
  • CANCELED
  • null This will un-register all callbacks
callback function
  • optional

public offStatusChange(callback: function) source

Un-register a callback for all status change events

Params:

NameTypeAttributeDescription
callback function
  • optional

public on(status: string, callback: function) source

Register a callback for a status update

Params:

NameTypeAttributeDescription
status string

Can be:

  • ACCEPTED
  • REJECTED
  • CANCELED
callback function

public onStatusChange(callback: function) source

Register a callback for all status change events

Params:

NameTypeAttributeDescription
callback function

public reject(reason: string): Promise<Invite> source

Rejects the invitation. Only the receiver can reject the invitation.

Params:

NameTypeAttributeDescription
reason string
  • optional

The reason the receiver is rejecting the invite

Return:

Promise<Invite>