Commit 26680153 by Kim Peace

Merge branch 'develop' into 'develop_change_collaboration'

# Conflicts:
#   public_new/js/share.js
parents 38efe21c 0ef45e70
......@@ -201,6 +201,10 @@ function setSocketAction () {
type = text[1];
if (type == messageType.COMMUNICATIONSTART || type == messageType.COMMUNICATIONEND) {
collaborationType = text[2];
var meetingId = 0;
if (collaborationType == CHAT_UTIL.getCollaborationType(collaborationTypeKey.DOCUMENT)) {
meetingId = text[3];
}
var userInCollaboration;
if (CHAT_UTIL.isIOS()) {
userInCollaboration = JSON.parse(CHAT_DB.getUserInfoList(message.userId));
......@@ -218,6 +222,7 @@ function setSocketAction () {
insertDate: message.insertDate,
collaborationType: collaborationType,
isToday: true,
meetingId: meetingId,
createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime,
isOtherYear: false
......
......@@ -254,6 +254,7 @@ $(function () {
break;
case "JoinRoomResponse":
if (json.resultCode == 200) {
hostSearchInterval();
for (let key in g_participants) {
loginIdList.push(key);
}
......@@ -307,29 +308,29 @@ function Coview_moveToVideoShareArea() {
}
function Coview_exitCollaboration(isDocument = false) {
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
clearInterval(timeInterval);
coview_api.LeaveRoom();
if (coview_api.getRoomUsers()) { android.finishCollaboration() };
isLeaved = true;
if (collaborationJoinFlg != '2') {
CHAT_UI.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
}
clearInterval(timeInterval);
coview_api.LeaveRoom();
if (coview_api.getRoomUsers()) { android.finishCollaboration() };
isLeaved = true;
if (collaborationJoinFlg != '2') {
CHAT_UI.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
} else {
if (typeof android != "undefined") {
android.openCommunicationHome();
} else {
if (typeof android != "undefined") {
android.openCommunicationHome();
} else {
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
}
}
function Coview_changeHost(userId) {
......@@ -339,7 +340,23 @@ function Coview_changeHost(userId) {
function Coview_addLoginId(loginId) {
console.log("addUser loginId = " + loginId);
coview_api.addUser(loginId);
var url = "https://livetaskyell.abookcloud.com/auth/getuser";
$.ajax({
url : url,
method : 'post',
data : {
id : loginId
},
success : function (result) {
console.log("result", result);
if (result.statusCode != 200) {
coview_api.addUser(loginId);
}
},
error : function (err) {
console.log(err.toString());
}
});
}
function Coview_connect_audio_collaboration() {
......@@ -351,30 +368,31 @@ function Coview_connect_audio_collaboration() {
}
function hostSearchInterval() {
let hostName = "";
function hostSearch() {
if (hostName != g_isMainManUsername) {
if (hostName != "") {
$("#collaboration_user_" + hostName).removeClass("host");
}
$("#collaboration_user_" + g_isMainManUsername).addClass("host");
hostName = g_isMainManUsername;
} else {
if (hostName == "") {
if (!$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).hasClass("host") && coview_api.getRoomUsers()) {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).addClass("host");
}
} else {
if (!$("#collaboration_user_" + hostName).hasClass('host')) {
$("#collaboration_user_" + hostName).addClass("host");
}
}
let hostName = "";
function hostSearch() {
if (hostName != g_isMainManUsername) {
if (hostName != "") {
$("#collaboration_user_" + hostName).removeClass("host");
}
$("#collaboration_user_" + g_isMainManUsername).addClass("host");
hostName = g_isMainManUsername;
} else {
if (hostName == "") {
if (!$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).hasClass("host") && coview_api.getRoomUsers()) {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).addClass("host");
}
} else {
if (!$("#collaboration_user_" + hostName).hasClass('host')) {
$("#collaboration_user_" + hostName).addClass("host");
}
if (g_isMainMan) {
$('.host_contents').removeClass('none');
} else {
$('.host_contents').addClass('none');
}
}
}
timeInterval = setInterval(hostSearch, 3000);
}
timeInterval = setInterval(hostSearch, 3000);
}
\ 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