Interface ChatContactEventListener

The contact update listener.

It listens for contact changes, including adding or removing a friend and accepting and declining a friend request.

For descriptions of callback methods in the listener, user A acts as the current user and user B serves as the peer user.

interface ChatContactEventListener {
    onContactAdded?(userName: string): void;
    onContactDeleted?(userName: string): void;
    onContactInvited?(userName: string, reason?: string): void;
    onFriendRequestAccepted?(userName: string): void;
    onFriendRequestDeclined?(userName: string): void;
}

Methods

  • Occurs when a friend request from the current user is accepted by the peer user.

    For example, after user B accepts a friend request from user A, user A receives this callback.

    Parameters

    • userName: string

      The user ID of the user that accepts the friend request of the current user.

    Returns void

  • Occurs when a friend request from the current user is declined by the peer user.

    For example, after user B declines a friend request from user A, user A receives this callback.

    Parameters

    • userName: string

      The user that declines the friend request from the current user.

    Returns void

  • Occurs when a friend request is received by the current user.

    For example, after user A receives a friend request from user B, user A receives this callback.

    Parameters

    • userName: string

      The user who initiates the friend request.

    • Optionalreason: string

      The invitation message.

    Returns void

  • Occurs when a friend request is accepted by the current user.

    For example, after user A accepts a friend request from user B, user A receives this callback.

    Parameters

    • userName: string

      The user who initiates the friend request.

    Returns void

  • Occurs when a friend request is declined by the current user.

    For example, after user A declines a friend request from user B, user A receives this callback.

    Parameters

    • userName: string

      The user who initiates the friend request.

    Returns void