Commit 7cecb9a1 by Kim Eunchul

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

parent 2386e61d
......@@ -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 unwrappedMessageInfo = decodeMessage(message.text);
const unwrappedMessageInfo = CHAT_SOCKET.decodeMessage(message.text);
if (
unwrappedMessageInfo ==
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
) {
cleanUpCollaborationMessage();
CHAT_SOCKET.cleanUpCollaborationMessage();
return;
}
......@@ -29,7 +29,7 @@ var handleMessage = function (message, roomName, socketKey) {
if (
messageType == SOCKET_KEY.NEW_COMMUNICATION
) {
addCollaborationMessage(
CHAT_SOCKET.addCollaborationMessage(
messageInfo,
message.userId,
roomName,
......@@ -37,7 +37,7 @@ var handleMessage = function (message, roomName, socketKey) {
message.createdAt
);
} else {
addTextMessage(messageText, message, socket.id);
CHAT_SOCKET.addTextMessage(messageText, message, socket.id);
}
if (typeof ChatRoom !== "undefined") {
......@@ -45,10 +45,12 @@ var handleMessage = function (message, roomName, socketKey) {
setTimeout(function () {
ChatRoom.scrollToBottom();
}, 300);
} else {
Common.dismissLoadingIndicator();
}
}
var decodeMessage = function (text) {
CHAT_SOCKET.decodeMessage = function (text) {
try {
return decodeURIComponent(text);
} 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