Commit 7cecb9a1 by Kim Eunchul

#43695 ウェブソケットの送信方式変更

parent 2386e61d
...@@ -10,15 +10,15 @@ CHAT_SOCKET.bindOnNewMessage = function () { ...@@ -10,15 +10,15 @@ CHAT_SOCKET.bindOnNewMessage = function () {
}); });
}; };
var handleMessage = function (message, roomName, socketKey) { CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) {
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE); const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text); const unwrappedMessageInfo = CHAT_SOCKET.decodeMessage(message.text);
if ( if (
unwrappedMessageInfo == unwrappedMessageInfo ==
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
) { ) {
cleanUpCollaborationMessage(); CHAT_SOCKET.cleanUpCollaborationMessage();
return; return;
} }
...@@ -29,7 +29,7 @@ var handleMessage = function (message, roomName, socketKey) { ...@@ -29,7 +29,7 @@ var handleMessage = function (message, roomName, socketKey) {
if ( if (
messageType == SOCKET_KEY.NEW_COMMUNICATION messageType == SOCKET_KEY.NEW_COMMUNICATION
) { ) {
addCollaborationMessage( CHAT_SOCKET.addCollaborationMessage(
messageInfo, messageInfo,
message.userId, message.userId,
roomName, roomName,
...@@ -37,7 +37,7 @@ var handleMessage = function (message, roomName, socketKey) { ...@@ -37,7 +37,7 @@ var handleMessage = function (message, roomName, socketKey) {
message.createdAt message.createdAt
); );
} else { } else {
addTextMessage(messageText, message, socket.id); CHAT_SOCKET.addTextMessage(messageText, message, socket.id);
} }
if (typeof ChatRoom !== "undefined") { if (typeof ChatRoom !== "undefined") {
...@@ -45,10 +45,12 @@ var handleMessage = function (message, roomName, socketKey) { ...@@ -45,10 +45,12 @@ var handleMessage = function (message, roomName, socketKey) {
setTimeout(function () { setTimeout(function () {
ChatRoom.scrollToBottom(); ChatRoom.scrollToBottom();
}, 300); }, 300);
} else {
Common.dismissLoadingIndicator();
} }
} }
var decodeMessage = function (text) { CHAT_SOCKET.decodeMessage = function (text) {
try { try {
return decodeURIComponent(text); return decodeURIComponent(text);
} catch (e) { } catch (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment