Is the message of a friend chatting in the background processed before sending or sending the original message to the front end for processing?

Source: Internet
Author: User
The title is not clear enough, and then the details are explained below.
A message that the user needs to receive.
One is in the server based on the last operation to determine the state, such as whether the Chat window is open, and then according to the status of sending different messages, such as the Chat window opened to send chat messages, if not open, send a message prompt.
The other is the server sends a message, and then a user receives after the use of JS to determine whether the window is open and then select the prompt or display.

I think the first way to the information of a higher degree of control, and the server computer than the client's good, can guarantee the integrity of the information. But if the state gets the wrong thing, it's going to get messed up.
The second way is easy to write, but is not a user-side experience is not very good, after all, to do logical processing.

The service-side code is written on the basis of Wokerman, and should not be relevant to this issue.

Or is there any other better way? I hope our predecessors will not hesitate to enlighten. Thank you, sir.

Reply content:

The title is not clear enough, and then the details are explained below.
A message that the user needs to receive.
One is in the server based on the last operation to determine the state, such as whether the Chat window is open, and then according to the status of sending different messages, such as the Chat window opened to send chat messages, if not open, send a message prompt.
The other is the server sends a message, and then a user receives after the use of JS to determine whether the window is open and then select the prompt or display.

I think the first way to the information of a higher degree of control, and the server computer than the client's good, can guarantee the integrity of the information. But if the state gets the wrong thing, it's going to get messed up.
The second way is easy to write, but is not a user-side experience is not very good, after all, to do logical processing.

The service-side code is written on the basis of Wokerman, and should not be relevant to this issue.

Or is there any other better way? I hope our predecessors will not hesitate to enlighten. Thank you, sir.

Send the original message to the front-end for processing, this processing does not affect the user experience

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.