Commit 6dbdee16 by Kim Peace

Merge branch 'feature/start_collaboration_when_other_exist' into debug/console_logs

# Conflicts:
#	public_new/js/sockets/chat-websocket-message.js
parents be5a05b8 03f6112a
...@@ -179,9 +179,9 @@ Common.startCollaboration = function (collaborationType) { ...@@ -179,9 +179,9 @@ Common.startCollaboration = function (collaborationType) {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
return; return;
} }
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(SOCKET_KEY.CREATE_MESSAGE, sendData);
NativeBridgeDelegate.finishAllCollaboration();
} }
CHAT_SOCKET.emitCollaborationFinishMessage();
NativeBridgeDelegate.finishAllCollaboration();
NativeBridgeDelegate.startCollaboration(collaborationType); NativeBridgeDelegate.startCollaboration(collaborationType);
}; };
...@@ -35,6 +35,10 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) { ...@@ -35,6 +35,10 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) {
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
) { ) {
CHAT_SOCKET.cleanUpCollaborationMessage(); CHAT_SOCKET.cleanUpCollaborationMessage();
if (typeof CoviewBridge !== "undefined") {
CoviewBridge.finishCollaboration();
}
return; return;
} }
...@@ -168,6 +172,7 @@ CHAT_SOCKET.renderCollaborationMessage = function ( ...@@ -168,6 +172,7 @@ CHAT_SOCKET.renderCollaborationMessage = function (
createdAtDay: messageTime.createdAtDay, createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime, createdAtTime: messageTime.createdAtTime,
isOtherYear: false, isOtherYear: false,
collaborationJoinMessage: getLocalizedString("message_join"),
}); });
}; };
...@@ -232,9 +237,12 @@ CHAT_SOCKET.getUserInfoList = function (userID) { ...@@ -232,9 +237,12 @@ CHAT_SOCKET.getUserInfoList = function (userID) {
return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID)); return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
}; };
CHAT_SOCKET.cleanUpCollaborationMessage = function () { CHAT_SOCKET.cleanUpCollaborationMessage = function (exceptFirst = false) {
console.log("peacekim:: CHAT_SOCKET.cleanUpCollaborationMessage"); console.log("peacekim:: CHAT_SOCKET.cleanUpCollaborationMessage");
$(".collabo_area.start").each(function (index, collaborationMessage) { $(".collabo_area.start").each(function (index, collaborationMessage) {
if (exceptFirst && index === 0) {
return;
}
$(collaborationMessage).removeClass("start"); $(collaborationMessage).removeClass("start");
$(collaborationMessage).addClass("end"); $(collaborationMessage).addClass("end");
$(collaborationMessage).addClass("disable"); $(collaborationMessage).addClass("disable");
......
...@@ -110,6 +110,8 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) { ...@@ -110,6 +110,8 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID); let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID);
ChatRoom.prependMessage(messages); ChatRoom.prependMessage(messages);
CHAT_SOCKET.cleanUpCollaborationMessage(true);
window.addEventListener( window.addEventListener(
"load", "load",
function (event) { function (event) {
......
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