Commit d98921de by Kim Peace

Merge branch 'feature/host_change' into debug/console_logs

# Conflicts:
#	public_new/js/views/collaboration/fermi-web-socket-bridge.js
#	public_new/js/views/collaboration/fermi-web-socket-message-handler.js
parents 6a8069c8 f1563ade
...@@ -61,15 +61,18 @@ FermiWebSocketBridge.hostRequestDone = function (hostID) { ...@@ -61,15 +61,18 @@ FermiWebSocketBridge.hostRequestDone = function (hostID) {
// GET_COLLABORATION_TYPE_RESPONSE // GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) { FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) {
if (typeof meetingID == undefined) {
var meetingID = 0;
}
console.log( console.log(
"peacekim:: FermiWebSocketBridge.getCollaborationTypeResponse hostID: " + "peacekim:: FermiWebSocketBridge.getCollaborationTypeResponse hostID: " +
loginID + loginID +
", meetingID: " + ", meetingID: " +
meetingID meetingID
); );
if (typeof meetingID == undefined ) {
var meetingID = 0;
}
fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", { fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", {
loginId: loginID, loginId: loginID,
collaborationType: globalUserInfo.collaborationType, collaborationType: globalUserInfo.collaborationType,
...@@ -127,3 +130,7 @@ FermiWebSocketBridge.changeHostApply = function () { ...@@ -127,3 +130,7 @@ FermiWebSocketBridge.changeHostApply = function () {
hostId: globalUserInfo.loginId, hostId: globalUserInfo.loginId,
}); });
}; };
FermiWebSocketBridge.hostUpdated = function () {
fw.sendToMsg("others", "HOST_UPDATED", {});
};
...@@ -91,7 +91,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) { ...@@ -91,7 +91,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
case "API_SEND_OWNER_CHANGE_COMPLETE": case "API_SEND_OWNER_CHANGE_COMPLETE":
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete(data); FermiWebSocketMessageHandler.apiSendOwnerChangeComplete(data);
CollaborationFeature.updateHost(); CollaborationFeature.updateHost();
FermiWebSocketBridge.hostUpdated();
break; break;
case "API_SEND_OWNER_CHANGE_CONFIRM": case "API_SEND_OWNER_CHANGE_CONFIRM":
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
...@@ -118,6 +118,10 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) { ...@@ -118,6 +118,10 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
CollaborationFeature.updateHost(); CollaborationFeature.updateHost();
CollaborationUI.userListSlideOut(); CollaborationUI.userListSlideOut();
$(".profile_favorite_btn").click(); $(".profile_favorite_btn").click();
break;
case "HOST_UPDATED":
CollaborationFeature.updateHost();
break;
default: default:
break; break;
} }
...@@ -338,7 +342,8 @@ FermiWebSocketMessageHandler.getCollaborationType = function (data) { ...@@ -338,7 +342,8 @@ FermiWebSocketMessageHandler.getCollaborationType = function (data) {
// GET_COLLABORATION_TYPE_RESPONSE // GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) { FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
const collaborationType = data.payload.collaborationType; const collaborationType = data.payload.collaborationType;
const meetingID = data.payload.newMeetingId; const meetingID = data.payload.newMeetingId ?? 0;
console.log( console.log(
"peacekim:: FermiWebSocketMessageHandler.getCollaborationTypeResponse globalUserInfo.collaborationType: " + "peacekim:: FermiWebSocketMessageHandler.getCollaborationTypeResponse globalUserInfo.collaborationType: " +
globalUserInfo.collaborationType + globalUserInfo.collaborationType +
...@@ -347,6 +352,7 @@ FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) { ...@@ -347,6 +352,7 @@ FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
", meetingID: " + ", meetingID: " +
meetingID meetingID
); );
FermiWebSocketMessageHandler.updateJoinChangeCollaboration(collaborationType); FermiWebSocketMessageHandler.updateJoinChangeCollaboration(collaborationType);
globalUserInfo.meetingID = meetingID; globalUserInfo.meetingID = meetingID;
CollaborationUI.updateScreen(globalUserInfo.collaborationType); CollaborationUI.updateScreen(globalUserInfo.collaborationType);
......
...@@ -284,7 +284,7 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () { ...@@ -284,7 +284,7 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () {
}; };
CoviewBridge.changeHostFromModal = function () { CoviewBridge.changeHostFromModal = function () {
const userID = $("#changeHostModal").data("bs.modal")._config.collaborationid const userID = $("#changeHostModal").data("bs.modal")._config.collaborationid;
// call in agent_app.js // call in agent_app.js
coview_api.HostChange(userID); coview_api.HostChange(userID);
}; };
...@@ -365,10 +365,16 @@ CollaborationUI.showHostMark = function (hostName) { ...@@ -365,10 +365,16 @@ CollaborationUI.showHostMark = function (hostName) {
// remove all host mark // remove all host mark
attendingUsers.forEach(function (userName) { attendingUsers.forEach(function (userName) {
// hide other user's video area
$(userName).hide();
// remove host mark
const user = "#collaboration_user_" + getReplacedLoginId(userName); const user = "#collaboration_user_" + getReplacedLoginId(userName);
$(user).removeClass("host"); $(user).removeClass("host");
}); });
// show host video area
$(hostName).show();
// set host name as current user if host name is not set // set host name as current user if host name is not set
if (hostName == "") { if (hostName == "") {
hostName = getReplacedLoginId(globalUserInfo.loginId); hostName = getReplacedLoginId(globalUserInfo.loginId);
......
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