Skip to content

View: chat

tmorris42 edited this page Jun 14, 2022 · 5 revisions

Components

Channels List (component)

  • tab: channels/conversations (component)
  • tab: join channel (component)
    • list: public and protected channels
      • icon: for protected channels
    • button: create new channel
  • tab: message friend (component)
    • list: friends

Message Window / Channel View

  • title: selected channel/friend
  • list: users in channel
    • admin options
      • mute User
      • ban User
      • make User a mod
    • user options
      • dm User
      • block User
      • friend User
      • Challenge User
  • list: messages in channel
    • admin options
      • mute User
      • ban User
      • delete Message (optional?)
      • make User a mod
    • user options
      • dm User
      • block User
      • friend User
      • Challenge User
  • input: message text box
  • button: send
  • admin options:
    • add User to Channel
    • change Channel type
    • change Channel password

Routes Needed

Http

  • GET /channels: all public/protected/private channels which the User can see
  • POST /channels: create new channel
  • PATCH /channels/<channelId>: update channel type and/or password
  • DELETE /channels/<channelId>: delete Channel
  • GET /memberships: all channels to which the User belongs
  • POST /memberships: add User to Channel as participant or admin
  • PATCH /memberships/<membershipId>: update User's role and mute/ban status
  • DELETE /memberships/<membershipId>: remove User from Channel
  • GET /messages/?channelId=<channelId>: messages in a given channel (paginated)
  • DELETE /messages/<messageId>: delete Message
  • GET /relationships (TBD): all friends of the user

Ws

Emit

  • chat-send, ChatSendDto { channel: <channelId: number>, message: <message: string>}: to send a message to a channel
  • chat-auth, { authorization: <JWT: string> }: authenticate the socket using valid JWT
  • chat-join, { channel: <channelId: number> }: request to receive messages for a given channel
  • chat-mod-user, TBD{}: send a mod action to ban/mute/remove/promote User
  • chat-mod-message, TBD{}: send a mod action to remove/edit a message (optional?)
  • chat-mod-channel, TBD{}: change channel type/password

Listen

  • chat-message: receive messages
  • chat-message-deleted: receive notification of a deleted message
  • chat-karma: receive notification of mute/ban to User

Clone this wiki locally