Answer the question
In order to leave comments, you need to log in
How to implement a feature in the chat?
I'm working on a social application (no, I don't want to become the second Durov, the implementation is purely interesting) and the question arose: how to make the "User is typing a message" feature in the chat window? Do I need to put some kind of listener on the text field? Or write the state somewhere? Or some other method.
Answer the question
In order to leave comments, you need to log in
You can look at the example of VK :
1. When the user starts typing something, a status change request is sent. Yes, it needs a listener.
2. The server temporarily (10 seconds) stores information that the user is typing a message.
3. If text input continues after 5 seconds or more, a second request is sent to extend the status for another 10 seconds.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question