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

Consists of all socket apis relating to a conversation group activites

extends

realTimeBase

Hierarchy

  • realTimeBase
    • conversationSocket

Index

Constructors

constructor

  • Returns conversationSocket

Properties

Private pageLength

pageLength: number = 20

Protected request

request: any

Protected resHeaders

resHeaders: any[] = []

Methods

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

changeGroupSubject

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

    changeGroupSubject

    description

    Allows to change the name of the group. A user may edit the current name or change the group name entirely using changeGroupSubject.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Conversation group id along with the changed name of the group

    Returns Promise<void>

chatHistory

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

    chatHistory

    description

    Whenever a user clicks on a user name or a group name, the conversation with that particular group opens up. The chatHistory gives us the recent 20 messages of that particular conversation that must be displayed.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      ID of the conversation group

    Returns Promise<void>

chatHistoryUpdation

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

    chatHistoryUpdation

    description

    When a user scrolls up, the previous messages of the group are displayed.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Conversation details like ID,chatcount,page no of the conversation

    Returns Promise<void>

chats

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

    chats

    description

    Allows to send a message in a conversation. The sent message is stored in database.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Data of the message to be sent

    Returns Promise<void>

commonGrp

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

    commonGrp

    description

    A user may be a part of many groups. The api gives the mutual groups with a particular user.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      ID of the other user with whom the mutual groups are to be found

    Returns Promise<void>

conversation

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

    conversation

    description

    Particulars of the group containing all the messages are returned to a user.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      ID of the conversation group

    Returns Promise<void>

deleteMessage

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

    deleteMessage

    description

    A user can delete a particular message from a group or individual chat using deleteMessage.

    Parameters

    • $data: any

      Data about the message that is to be deleted from the group

    • $user: any

      User details of the requestor

    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

getCommonGroups

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

    A user may be a part of many groups. The api gives the list of names of mutual groups with all other participant users of the group.

    Parameters

    • $data: any

      Current active group ID

    Returns Promise<void>

getFavoriteMessages

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

    getFavoriteMessages

    description

    A user may mark messages as his favorites in a particular group. The api returns a list of all the messages that have been marked as favorites in a conversation.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      ID of the conversation group whose messages are to be found

    Returns Promise<void>

getLinks

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

    getLinks

    description

    A user may send certain important links as messages in a particular group. The api gives all the links present in a conversation.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      ID of the conversation group in which the links are to be found

    Returns Promise<void>

groupDetails

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

    groupDetails

    description

    Gives information about a group like the constituting users, name, whether a P2P chat or a group chat.

    Parameters

    • $data: any

      ID of the conversation group whose details are to be found

    Returns Promise<void>

lastSeen

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

    lastSeen

    description

    Gives the last message of the conversation

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      The message text and the group ID in which the message was sent

    Returns Promise<void>

Protected log

  • log(message: string): void
  • Parameters

    • message: string

    Returns void

markfavorite

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

    markfavorite

    description

    Some messages may be important hence need to be remembered. A user may mark a message as favorite in a conversation which highlights it from regular messages.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Message id that is to be marked favorite along with the conversation group ID

    Returns Promise<void>

removeUserRecent

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

    A user may have many conversations in his list. The api allows you to remove a conversation from our list.

    Parameters

    • $data: any

      ID of the conversation group to be removed

    Returns Promise<void>

typing

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

    typing

    description

    In a group, whenever other user is responding to a message one must be informed. The typing api displays '...other username is typing' when other user is typing a message on our screen.

    Parameters

    • $data: any

      ID of the conversation group that the other user is typing in a message

    • $user: any

      User details of the requestor

    Returns Promise<void>

unmarkfavorite

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

    unmarkfavorite

    description

    Unmarks a favorited message in a conversation

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Message id that is to be unmarked from favorite along with the conversation group ID

    Returns Promise<void>

unreadChat

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

    unreadChat

    description

    A user may have unread messages in a group conversation or individual chat. unreadChat gives the unread messages count for that particular group.

    Parameters

    • $user: any

      User details of the requestor

    • $data: any

      Conversation groups' array of a user

    Returns Promise<void>

Generated using TypeDoc