Commit f1f47181 by Kim Peace

Merge branch 'squash/socket_kim-ec' into 'develop'

Squash/socket kim ec

See merge request !228
parents ca5452d0 b4c29715
...@@ -5,12 +5,12 @@ CHAT_SOCKET.bindOnNewMessage = function () { ...@@ -5,12 +5,12 @@ CHAT_SOCKET.bindOnNewMessage = function () {
CHAT_SOCKET.handleMessage(message, roomName, SOCKET_KEY.NEW_MESSAGE); CHAT_SOCKET.handleMessage(message, roomName, SOCKET_KEY.NEW_MESSAGE);
}); });
socket.on(SOCKET_KEY.NEW_COMMUNICATION, function (message, roomID, roomName) { socket.on(SOCKET_KEY.NEW_COMMUNICATION, function (message, roomID, roomName, collaborationType, meetingID) {
CHAT_SOCKET.handleMessage(message, roomName, SOCKET_KEY.NEW_COMMUNICATION); CHAT_SOCKET.handleMessage(message, roomName, SOCKET_KEY.NEW_COMMUNICATION, collaborationType, meetingID);
}); });
}; };
CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) { CHAT_SOCKET.handleMessage = function (message, roomName, socketKey, collaborationType = null, meetingID = null) {
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE); const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = CHAT_SOCKET.decodeMessage(message.text); const unwrappedMessageInfo = CHAT_SOCKET.decodeMessage(message.text);
...@@ -36,7 +36,9 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) { ...@@ -36,7 +36,9 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) {
message.userId, message.userId,
roomName, roomName,
message.insertDate, message.insertDate,
message.createdAt message.createdAt,
collaborationType,
meetingID
); );
} else { } else {
CHAT_SOCKET.addTextMessage(messageText, message, socket.id); CHAT_SOCKET.addTextMessage(messageText, message, socket.id);
...@@ -65,10 +67,12 @@ CHAT_SOCKET.addCollaborationMessage = function ( ...@@ -65,10 +67,12 @@ CHAT_SOCKET.addCollaborationMessage = function (
userID, userID,
roomName, roomName,
insertDate, insertDate,
createdAt createdAt,
collaborationTypeInfo,
meetingIDInfo
) { ) {
const collaborationType = CHAT_UTIL.getCollaborationType(messageInfo[2]); const collaborationType = collaborationTypeInfo;
const meetingID = CHAT_SOCKET.getMeetingID(collaborationType, messageInfo); const meetingID = meetingIDInfo;
const userInCollaboration = JSON.parse( const userInCollaboration = JSON.parse(
NativeBridgeDataSource.getUserInfoList(userID) NativeBridgeDataSource.getUserInfoList(userID)
); );
......
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