skype-clone icon indicating copy to clipboard operation
skype-clone copied to clipboard

/get_message_detail endpoint

Open aemal opened this issue 7 years ago • 0 comments

@Yassermorteza please make this endpoint as per our phone conversation and you can find its detailed description from the following list:

  1. It should be a post method and expect two params; userID & friendID
  2. Query chat.participants and get the _id with the combinations participants[userID, friendID] || participants[friendID, userID] as the initial click on the friend list may occur from either side.
  3. If the query returns a result, get all the messages of that chat id, curate an object and send it back along with the chat._id
  4. If the query doesn't return a result (means it is the first time these two friends are chatting), then insert a record in chat collection and return chat._id as it will be used for the socket.io room.

Good luck hacking 👍 💻 👨‍💻

aemal avatar Feb 08 '18 09:02 aemal