I have test with your first solution @baris
Result :the user who sends the message does not see it displayed. For this he must refresh the page with F5 = no refresh of the chat. The other users do receive a notification, which the oin does not want.
--> The global chat should refresh itself when sending a message from anyone without notifying the members of the chat room