Commit f41ee336 by Kim Peace

Merge branch 'fix/post_message_for_ios' into 'develop'

Fixed post message key

See merge request !173
parents 6d617479 72dd73de
CHAT_UI.joinCollaboration = function (collaborationType, meetingId = 0) { CHAT_UI.joinCollaboration = function (collaborationType, meetingId = 0) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
const COLLABORATION_TYPE_KEY = POST_MESSAGE_KEY.COLLABORATION_TYPE;
const MEETING_ID_KEY = POST_MESSAGE_KEY.MEETING_ID;
webkit.messageHandlers.joinCollaboration.postMessage({ webkit.messageHandlers.joinCollaboration.postMessage({
COLLABORATION_TYPE_KEY: collaborationType, collaborationType: collaborationType,
MEETING_ID_KEY: meetingId, meetingId: meetingId,
}); });
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
if ( if (
...@@ -395,11 +393,9 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () { ...@@ -395,11 +393,9 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () {
CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType) CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType)
); );
} else { } else {
const USER_ID_LIST_KEY = POST_MESSAGE_KEY.USER_ID_LIST;
const COLLABORATION_TYPE_KEY = POST_MESSAGE_KEY.COLLABORATION_TYPE;
webkit.messageHandlers.inviteCollaboration.postMessage({ webkit.messageHandlers.inviteCollaboration.postMessage({
USER_ID_LIST_KEY: userIdList.join(","), userIdList: userIdList.join(","),
COLLABORATION_TYPE_KEY: CHAT_UTIL.getCollaborationType( collaborationType: CHAT_UTIL.getCollaborationType(
globalUserInfo.coWorkType globalUserInfo.coWorkType
), ),
}); });
......
...@@ -142,9 +142,8 @@ $('a[data-toggle="pill"]').on("show.bs.tab", function (e) { ...@@ -142,9 +142,8 @@ $('a[data-toggle="pill"]').on("show.bs.tab", function (e) {
if (typeof android != "undefined") { if (typeof android != "undefined") {
android.updateRoomList(); android.updateRoomList();
} else { } else {
const GROUP_ID_KEY = POST_MESSAGE_KEY.GROUP_ID;
webkit.messageHandlers.updateRoomList.postMessage({ webkit.messageHandlers.updateRoomList.postMessage({
GROUP_ID_KEY: "0", groupId: "0",
}); });
} }
}); });
...@@ -1025,11 +1024,9 @@ CHAT_UI.joinRoom = function (roomId, roomName) { ...@@ -1025,11 +1024,9 @@ CHAT_UI.joinRoom = function (roomId, roomName) {
alert(getLocalizedString("err_not_exist_room")); alert(getLocalizedString("err_not_exist_room"));
} }
} else { } else {
const ROOM_ID_KEY = POST_MESSAGE_KEY.ROOM_ID;
const ROOM_NAME = POST_MESSAGE_KEY.ROOM_NAME;
webkit.messageHandlers.joinRoom.postMessage({ webkit.messageHandlers.joinRoom.postMessage({
ROOM_ID_KEY: roomId, roomId: roomId,
ROOM_NAME: roomName, roomName: roomName,
}); });
} }
}; };
...@@ -2170,9 +2167,8 @@ CHAT_UI.showAddUserConfirmView = function () { ...@@ -2170,9 +2167,8 @@ CHAT_UI.showAddUserConfirmView = function () {
if (typeof android != "undefined") { if (typeof android != "undefined") {
android.inviteUsers(userIdList.join(","), false); android.inviteUsers(userIdList.join(","), false);
} else { } else {
const USER_ID_LIST_KEY = POST_MESSAGE_KEY.USER_ID_LIST;
webkit.messageHandlers.inviteUsers.postMessage({ webkit.messageHandlers.inviteUsers.postMessage({
USER_ID_LIST_KEY: userIdList.join(","), userIdList: userIdList.join(","),
}); });
} }
}); });
...@@ -2400,8 +2396,7 @@ CHAT_UI.offlineHandler = function (e) { ...@@ -2400,8 +2396,7 @@ CHAT_UI.offlineHandler = function (e) {
CHAT_UI.displayExistRoom = function (roomId) { CHAT_UI.displayExistRoom = function (roomId) {
if (confirm("error_already_exist_same_user")) { if (confirm("error_already_exist_same_user")) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
const ROOM_ID_KEY = POST_MESSAGE_KEY.ROOM_ID; webkit.messageHandlers.joinRoom.postMessage({ roomId: roomId });
webkit.messageHandlers.joinRoom.postMessage({ ROOM_ID_KEY: roomId });
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.joinRoom(roomId, ""); android.joinRoom(roomId, "");
} }
...@@ -2426,17 +2421,12 @@ var createChatRoom = function ( ...@@ -2426,17 +2421,12 @@ var createChatRoom = function (
isVoice isVoice
); );
} else { } else {
const ROOM_TYPE_KEY = POST_MESSAGE_KEY.ROOM_TYPE;
const USER_ID_LIST_KEY = POST_MESSAGE_KEY.USER_ID_LIST;
const ROOM_NAME_KEY = POST_MESSAGE_KEY.ROOM_NAME;
const SCREEN_FLAG_KEY = POST_MESSAGE_KEY.SCREEN_FLAG;
const IS_VOICE_KEY = POST_MESSAGE_KEY.IS_VOICE;
webkit.messageHandlers.createChatRoom.postMessage({ webkit.messageHandlers.createChatRoom.postMessage({
ROOM_TYPE_KEY: chatRoomType, roomType: chatRoomType,
USER_ID_LIST_KEY: userIDList.join(","), userIdList: userIDList.join(","),
ROOM_NAME_KEY: newRoomName, roomName: newRoomName,
SCREEN_FLAG_KEY: screenFlag, screenFlag: screenFlag,
IS_VOICE_KEY: isVoice, isVoice: isVoice,
}); });
} }
}; };
......
...@@ -19,11 +19,9 @@ CHAT.saveRoomInfo = function (roomId, roomName) { ...@@ -19,11 +19,9 @@ CHAT.saveRoomInfo = function (roomId, roomName) {
CHAT.globalLoginParameter.roomId = roomId; CHAT.globalLoginParameter.roomId = roomId;
CHAT.globalLoginParameter.roomName = roomName; CHAT.globalLoginParameter.roomName = roomName;
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
const ROOM_ID_KEY = POST_MESSAGE_KEY.ROOM_ID;
const ROOM_NAME_KEY = POST_MESSAGE_KEY.ROOM_NAME;
webkit.messageHandlers.roomInfosaveMessageHandlerId.postMessage({ webkit.messageHandlers.roomInfosaveMessageHandlerId.postMessage({
ROOM_ID_KEY: roomId, roomId: roomId,
ROOM_NAME_KEY: roomName, roomName: roomName,
}); });
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
if (roomId == undefined && roomName == undefined) { if (roomId == undefined && roomName == undefined) {
...@@ -580,7 +578,9 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -580,7 +578,9 @@ document.addEventListener("DOMContentLoaded", function () {
var keyword = $('.chat_room_src_form input[type="search"]').val(); var keyword = $('.chat_room_src_form input[type="search"]').val();
$(".overlay_src_msg").empty(); $(".overlay_src_msg").empty();
let checkedUserList = getCheckedUserList(); let checkedUserList = getCheckedUserList();
if (keyword.length == 1) { return; } if (keyword.length == 1) {
return;
}
const messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(",")); const messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE); var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE); var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
......
...@@ -149,17 +149,3 @@ const NATIVE_KEY_IOS = { ...@@ -149,17 +149,3 @@ const NATIVE_KEY_IOS = {
getUserInfo: "getUserInfo", getUserInfo: "getUserInfo",
getUserListByLoginId: "getUserListByLoginId", getUserListByLoginId: "getUserListByLoginId",
}; };
const POST_MESSAGE_KEY = {
COLLABORATION_TYPE: "collaborationType",
MEETING_ID: "meetingId",
ROOM_ID: "roomId",
ROOM_NAME: "roomName",
USER_ID_LIST: "userIdList",
GROUP_ID: "groupId",
ROOM_TYPE: "roomType",
SCREEN_FLAG: "screenFlag",
IS_VOICE: "isVoice",
JOIN_COLLABORATION_TYPE: "joinCollaborationType",
CHANGE_COLLABORATION_TYPE: "changeCollaborationType"
};
...@@ -153,11 +153,9 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -153,11 +153,9 @@ document.addEventListener("DOMContentLoaded", function () {
initCollaborationUI(joinCollaborationType); initCollaborationUI(joinCollaborationType);
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
const JOIN_COLLABORATION_TYPE_KEY = POST_MESSAGE_KEY.JOIN_COLLABORATION_TYPE;
const MEETING_ID_KEY = POST_MESSAGE_KEY.MEETING_ID;
webkit.messageHandlers.joinChangedCollaboration.postMessage({ webkit.messageHandlers.joinChangedCollaboration.postMessage({
JOIN_COLLABORATION_TYPE_KEY: joinCollaborationType, joinCollaborationType: joinCollaborationType,
MEETING_ID_KEY: data.payload.newMeetingId, meetingId: data.payload.newMeetingId,
}); });
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) { if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
webkit.messageHandlers.joinMeetingRoom.postMessage( webkit.messageHandlers.joinMeetingRoom.postMessage(
...@@ -548,11 +546,9 @@ function changeCollaboration(changeCollaborationType) { ...@@ -548,11 +546,9 @@ function changeCollaboration(changeCollaborationType) {
} }
penOff(); penOff();
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
const CHANGE_COLLABORATION_TYPE_KEY = POST_MESSAGE_KEY.CHANGE_COLLABORATION_TYPE;
const MEETING_ID_KEY = POST_MESSAGE_KEY.MEETING_ID;
webkit.messageHandlers.changeCollaboration.postMessage({ webkit.messageHandlers.changeCollaboration.postMessage({
CHANGE_COLLABORATION_TYPE_KEY: changeCollaborationType, changeCollaborationType: changeCollaborationType,
MEETING_ID_KEY: newMeetingId, meetingId: newMeetingId,
}); });
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.changeCollaboration(changeCollaborationType, newMeetingId); android.changeCollaboration(changeCollaborationType, newMeetingId);
......
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