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) {
// GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) {
if (typeof meetingID == undefined) {
var meetingID = 0;
}
console.log(
"peacekim:: FermiWebSocketBridge.getCollaborationTypeResponse hostID: " +
loginID +
", meetingID: " +
meetingID
);
if (typeof meetingID == undefined ) {
var meetingID = 0;
}
fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", {
loginId: loginID,
collaborationType: globalUserInfo.collaborationType,
......@@ -127,3 +130,7 @@ FermiWebSocketBridge.changeHostApply = function () {
hostId: globalUserInfo.loginId,
});
};
FermiWebSocketBridge.hostUpdated = function () {
fw.sendToMsg("others", "HOST_UPDATED", {});
};
......@@ -91,7 +91,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
case "API_SEND_OWNER_CHANGE_COMPLETE":
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete(data);
CollaborationFeature.updateHost();
FermiWebSocketBridge.hostUpdated();
break;
case "API_SEND_OWNER_CHANGE_CONFIRM":
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
......@@ -118,6 +118,10 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
CollaborationFeature.updateHost();
CollaborationUI.userListSlideOut();
$(".profile_favorite_btn").click();
break;
case "HOST_UPDATED":
CollaborationFeature.updateHost();
break;
default:
break;
}
......@@ -338,7 +342,8 @@ FermiWebSocketMessageHandler.getCollaborationType = function (data) {
// GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
const collaborationType = data.payload.collaborationType;
const meetingID = data.payload.newMeetingId;
const meetingID = data.payload.newMeetingId ?? 0;
console.log(
"peacekim:: FermiWebSocketMessageHandler.getCollaborationTypeResponse globalUserInfo.collaborationType: " +
globalUserInfo.collaborationType +
......@@ -347,6 +352,7 @@ FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
", meetingID: " +
meetingID
);
FermiWebSocketMessageHandler.updateJoinChangeCollaboration(collaborationType);
globalUserInfo.meetingID = meetingID;
CollaborationUI.updateScreen(globalUserInfo.collaborationType);
......
......@@ -284,7 +284,7 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = 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
coview_api.HostChange(userID);
};
......@@ -365,10 +365,16 @@ CollaborationUI.showHostMark = function (hostName) {
// remove all host mark
attendingUsers.forEach(function (userName) {
// hide other user's video area
$(userName).hide();
// remove host mark
const user = "#collaboration_user_" + getReplacedLoginId(userName);
$(user).removeClass("host");
});
// show host video area
$(hostName).show();
// set host name as current user if host name is not set
if (hostName == "") {
hostName = getReplacedLoginId(globalUserInfo.loginId);
......@@ -572,4 +578,4 @@ CollaborationUI.moveToVideoShareArea = function () {
CollaborationUI.showLoadingIndicator();
$(".coview_share_area").show();
$("#collabo_main").removeClass("none");
};
\ No newline at end of file
};
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