tienphuckx / anony-box-backbone

An anonymous chatting web
MIT License
3 stars 1 forks source link

feat(websocket): implement seen messages #31

Closed secretdeveloperisme closed 2 days ago

secretdeveloperisme commented 2 days ago

In this pull request, I have implements changing message status to seen realtime. I added some messages type structures:

SMessageType::SeenMessages JSON: The Seen message structure which contains list of messages_ids that client requests to change status of message to seen

{
  "SeenMessages": {
      "group_id": 24,
      "message_ids": [
          41,42
      ]
  }
}

SMessageType::SeenMessagesResponse JSON: After sending a seen message, if any error occurs the seen message response will be sent from server with a short message to explain the error.


{
  "SeenMessagesResponse": {
      "status_code": 4,
      "message": "One of messages is not belong to group 25"
  }
}

SMessageType::EditMessageData JSON: The message will be responded from server if a seen message request was processed successfully to inform all connected client in a group.

{
  "SeenMessagesEvent": [
    45,
    46
  ]
}