L
L
lavezzi12018-10-26 08:28:51
MySQL
lavezzi1, 2018-10-26 08:28:51

How are messages arranged in slack/discord?

Hello, please explain how messages are arranged in slack / discord chats, that is, group ones. Most interested in how to mark messages unread: true/false. If you look at the requests, there is no such parameter anywhere. However, in the application itself, you can see by the data attributes that they are somehow labeled somehow.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Arutyunov, 2018-10-26
@lavezzi1

Read about websockets . Almost all information related to chat goes over sockets. If you understand how websockets work, then you will understand how such chats work.
The unread status can be defined in different ways. One of the options is to show messages that users left after the last activity: the user logged out at 17:30, which means all messages after that will be unread. They can be made read when the user reconnects to the chat and unread messages are in the scope (scrolls through the history - messages are marked as read). In the same way, you can mark messages, if the user switches between channels - fix the moment when he left the channel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question