Options
All
  • Public
  • Public/Protected
  • All
Menu
class
classdesc

Consists of all socket apis relating to the Recent chats component

extends

realTimeBase

Hierarchy

  • realTimeBase
    • historySocket

Index

Constructors

constructor

  • Returns historySocket

Properties

Protected request

request: any

Protected resHeaders

resHeaders: any[] = []

Methods

addUser

  • addUser($user: any, $data: any): Promise<void>
  • function

    addUser

    description

    A user may add a particular user to an existing group. The api allows to add another user to an existing conversation group.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      User details of the user to be added to the group

    Returns Promise<void>

allUsers

  • allUsers($data: any, $user: any): Promise<void>
  • function

    allUsers

    description

    Returns a list of all users from DB except the requestor

    Parameters

    • $data: any

      User details

    • $user: any

      User details of requestor

    Returns Promise<void>

allUsersChatTransfer

  • allUsersChatTransfer($user: any, $data: any): Promise<void>
  • function

    allUsersChatTransfer

    description

    A user may transfer chat to another user. Gives a list of users from the database to whom a chat conversation can be transferred to.

    Parameters

    • $user: any

      User details of requestor

    • $data: any

      Details of the conversation group

    Returns Promise<void>

broadcast

  • broadcast(data: any): void
  • Parameters

    • data: any

    Returns void

broadcastAll

  • broadcastAll(data: any): void
  • Parameters

    • data: any

    Returns void

broadcastToSockets

  • broadcastToSockets(sockets: Array<string>, data: any): void
  • Parameters

    • sockets: Array<string>
    • data: any

    Returns void

chatUser

  • chatUser($user: any): Promise<void>
  • function

    chatUser

    description

    Gives details of the current user who is active i.e self @

    Parameters

    • $user: any

      User details of requestor

    Returns Promise<void>

createsChatGroup

  • createsChatGroup($user: any, $data: any): Promise<void>
  • function

    createsChatGroup

    description

    In order to begin chatting with a another user, a user must have certain room for it. The api creates a conversation group with user(s) to begin the conversation.

    Parameters

    • $user: any

      User details of requestor

    • $data: any

      Data consisting the group to be created

    Returns Promise<void>

emit

  • emit(data: any): void
  • Parameters

    • data: any

    Returns void

emitToGroup

  • emitToGroup(groupId: any, data: any): void
  • Parameters

    • groupId: any
    • data: any

    Returns void

Protected emitToRequest

  • emitToRequest(data: any): void
  • Parameters

    • data: any

    Returns void

history

  • history($user: any): Promise<void>
  • function

    history

    description

    A user may talk to different users or groups. The api gives the list of all the conversations the user has had till now.

    Parameters

    • $user: any

      User details of requestor

    Returns Promise<void>

leaveGroup

  • leaveGroup($user: any, $data: any): Promise<void>
  • function

    leaveGroup

    description

    A user may no more want to be a part of a group. The api allows a user to leave a particular group conversation.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Conversation Id of the group to be left

    Returns Promise<void>

Protected log

  • log(message: string): void
  • Parameters

    • message: string

    Returns void

removeUserFromGrp

  • removeUserFromGrp($user: any, $data: any): Promise<void>
  • function

    removeUserFromGrp

    description

    Allows the creator of the group to remove a particular user from the group

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Details of the user to be removed from the group

    Returns Promise<void>

showExistingChat

  • showExistingChat($data: any): Promise<void>
  • function

    showExistingChat

    description

    Whenever a user clicks on other user or group conversation, the api opens the existing conversation with a particular user or group.

    Parameters

    • $data: any

      ID of the conversation group that is to be opened

    Returns Promise<void>

transferChat

  • transferChat($user: any, $data: any): Promise<void>
  • function

    transferChat

    description

    Transfers a conversation to a user

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Details of group whose chat is to be transferred

    Returns Promise<void>

unreadMessages

  • unreadMessages($user: any, $data: any): Promise<void>
  • function

    unreadMessages

    description

    A user may have unread message in a group. The api notifies the user that he has any unread messages.

    Parameters

    • $user: any

      User details of requestor

    • $data: any

      ID of the conversation group

    Returns Promise<void>

userMessage

  • userMessage($user: any, $data: any): Promise<void>

Generated using TypeDoc