What I'm trying to achieve is to receive a message sent by a user in another window, however the response is printed multiple times.
Its seems to me like the 'DemoServerAdapter.prototype.sendMessage' function is called x times as messages already sent.
socket.on('chat_receive', function(message) {
console.log(message);
var echoMessage = new ChatMessageInfo();
echoMessage.UserFromId = message.send_user_id; // It will be from Echobot
echoMessage.RoomId = roomId;
echoMessage.ConversationId = conversationId;
echoMessage.Message = "The other: " + message.message;
// if it's not a private message, the echo message will be to the current user
if (!roomId && !conversationId)
echoMessage.UserToId = current_user_id; // Id del usuario actual
// this will send a message to the user 1 (you) as if it was from user 2 (Echobot)
_this.clientAdapter.triggerMessagesChanged(echoMessage);
});
What I'm trying to achieve is to receive a message sent by a user in another window, however the response is printed multiple times.
Its seems to me like the 'DemoServerAdapter.prototype.sendMessage' function is called x times as messages already sent.
Example: