var FermiWebSocketBridge = {};

// call from modal_collabo_profile.html
FermiWebSocketBridge.requestHostChange = function (loginID) {
  fw.sendToMsg("others", "HOST_CHANGE_REQUEST", {
    loginId: getFermiLoginId(loginID),
  });
};

FermiWebSocketBridge.shareFileHost = function (collaborationType) {
  fw.sendToMsg("others", "SHARE_FILE_HOST", {
    // TODO: Peacekim check collaboration type as coviewType
    collaborationType: collaborationType,
  });
};

FermiWebSocketBridge.hostChangeResponse = function () {
  fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
    isAndroid: deviceInfo.isAndroid(),
    isAble: deviceInfo.androidVersion >= ANDROID_SDK_VERSION.O,
    loginId: currentUserInfo.loginID,
  });
};

// PIP_END_REQUEST
FermiWebSocketBridge.pipEndRequest = function (loginID) {
  fw.sendToMsg("others", "PIP_END_REQUEST", {
    loginId: getFermiLoginId(loginID),
  });
};

// HOST_REQUEST_REJECT
FermiWebSocketBridge.hostRequestReject = function (hostID) {
  fw.sendToMsg("others", "HOST_REQUEST_REJECT", {
    hostId: hostID,
  });
};

// HOST_REQUEST_DONE
FermiWebSocketBridge.hostRequestDone = function (hostID) {
  fw.sendToMsg("others", "HOST_REQUEST_DONE", {
    hostId: hostID,
  });
};

// GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) {
  fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", {
    loginId: loginID,
    collaborationType: globalUserInfo.collaborationType,
    newMeetingId: meetingID,
  });
};

// GET_COLLABORATION_TYPE
FermiWebSocketBridge.getCollaborationType = function () {
  fw.sendToMsg("others", "GET_COLLABORATION_TYPE", {
    loginId: globalUserInfo.loginId,
  });
};

// CAPTURE_REQUEST
FermiWebSocketBridge.captureRequest = function () {
  // todo: peacekim:: check if it's okay for loginID
  // instead of globalUserInfo.loginId
  fw.sendToMsg("others", "CAPTURE_REQUEST", {
    name: currentUserInfo.loginID,
  });
};

// CHANGE_COLLABORATION
FermiWebSocketBridge.changeCollaboration = function (
  collaborationType,
  newMeetingID
) {
  fw.sendToMsg("others", "CHANGE_COLLABORATION", {
    collaborationType: collaborationType,
    newMeetingId: newMeetingID,
  });
};

// CHANGE_HOST_APPLY
FermiWebSocketBridge.changeHostApply = function () {
  fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
    hostId: currentUserInfo.loginID,
  });
};
