Home Reference Source
import {Contact} from '@quobis/sippojs'
public class | source

Contact

Extends:

src/eventemitter.js~EventEmitter → Contact

Represents a contact. This class must not be directly instantiated. Instead, instances of this class are obtained by calling the ContactManager#createContact or ContactManager#getContacts methods of {ContactManager}

Events

  • update is emitted every time the contact is updated.
  • delete is emitted when the contact is deleted.

Member Summary

Public Members
public get

Returns the address associated with the user represented by this contact

public get

avatar: *

public set
public get
public set
public get
public set
public get

email: *

public set
public get

emails: *

public set
public set

Whether the contact is favorite

public get
public get

Contact unique identifier

public get
public get
public get
public get

Name associated with this contact

public set

Display name associated with this contact

public set
public get

phone: *

public set
public get

phones: *

public get

Presence associated with this contact

public get

Source name of the contact's source

public set
public get
public set

Method Summary

Public Methods
public
public

Removes the contact

public

toJSON(): {"id": *, "name": *, "source": *, "favorite": *, "phones": *, "unnormalizedPhones": *, "emails": *, "deviceId": *, "contactDeviceId": *, "isWacUser": *}

Returns a JS object with the JSON serialization representation of this object

Public Members

public get address: string: * source

Returns the address associated with the user represented by this contact

Return:

string

public get avatar: * source

public set avatar source

public get contactDeviceId: * source

public set contactDeviceId source

public get deviceId: * source

public set deviceId source

public get email: * source

public set email source

public get emails: * source

public set emails source

public set favorite: boolean source

Whether the contact is favorite

public get favorite: * source

public get id: string source

Contact unique identifier

public get isEditable: * source

public get isErasable: * source

public get isWacUser: * source

public get name: string source

Name associated with this contact

public set name: string source

Display name associated with this contact

public set phone source

public get phone: * source

public set phones source

public get phones: * source

public get presence: Presence source

Presence associated with this contact

public get source: string source

Source name of the contact's source

public set source source

public get unnormalizedPhones: * source

public set unnormalizedPhones source

Public Methods

public getWacUserAddress(): * source

Return:

*

public remove(): Promise<undefined, Error> source

Removes the contact

Return:

Promise<undefined, Error>

public toJSON(): {"id": *, "name": *, "source": *, "favorite": *, "phones": *, "unnormalizedPhones": *, "emails": *, "deviceId": *, "contactDeviceId": *, "isWacUser": *} source

Returns a JS object with the JSON serialization representation of this object

Return:

{"id": *, "name": *, "source": *, "favorite": *, "phones": *, "unnormalizedPhones": *, "emails": *, "deviceId": *, "contactDeviceId": *, "isWacUser": *}