Commit b952b542 by Kim Peace

Divded all delegates and datasource from native value

parent 91c488ee
......@@ -108,11 +108,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- view -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......
......@@ -17,21 +17,6 @@
<link rel="stylesheet" href="./css/font-awesome.css">
</head>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
var kv = urlSearch[0].split('=');
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
if (typeof (android) != "undefined") {
} else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
}
});
</script>
<body>
<!-- ナビメニュー -->
......@@ -81,12 +66,12 @@
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- view -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/archive.js"></script>
<!-- Template archive-detail -->
......@@ -215,6 +200,22 @@
CHAT_UI.refreshArchiveDetailScreen(archiveId);
};
</script>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
var kv = urlSearch[0].split('=');
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
if (typeof (android) != "undefined") {
} else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
}
});
</script>
</body>
</html>
\ No newline at end of file
......@@ -114,11 +114,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......
......@@ -142,11 +142,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -174,8 +173,9 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers();
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
selectedUsers.forEach(function (user) {
CHAT.globalSelectedUserList.push(user.shopMemberId);
})
......
......@@ -72,12 +72,11 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/common/loading.js"></script>
......
......@@ -71,11 +71,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......
......@@ -143,11 +143,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -176,8 +175,8 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers();
if (NativeBridgeDataSource.loadSelectedUsers() != "") {
let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
selectedUsers.forEach(function (user) {
CHAT.globalSelectedUserList.push(user.shopMemberId);
})
......
......@@ -79,11 +79,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......
......@@ -160,11 +160,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......
......@@ -141,11 +141,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -203,12 +202,11 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
joinCollaborationType = CHAT_DB.getJoinCollaborationType();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
joinCollaborationType = android.getJoinCollaborationType();
collaborationJoinFlg = android.getCollaborationJoinFlg();
joinCollaborationType = NativeBridgeDataSource.getJoinCollaborationType();
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
if (CHAT_UTIL.isAndroid()) {
androidVersion = android.getAndroidVersion();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version'));
......@@ -222,8 +220,7 @@
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -84,11 +84,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -131,16 +130,11 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
};
</script>
</body>
......
......@@ -145,11 +145,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -194,17 +193,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -135,11 +135,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -185,17 +184,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -80,11 +80,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -129,17 +128,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -137,11 +137,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -187,16 +186,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -191,11 +191,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -225,14 +224,10 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
let groupId;
if (typeof (android) != "undefined") {
groupId = android.getToMoveGroupId();
} else {
groupId = CHAT_DB.getToMoveGroupId();
}
if (groupId != "" && groupId != undefined) {
CHAT_UI.refreshAllGroupSearch(groupId);
const groupID = NativeBridgeDataSource.getToMoveGroupId();
if (groupID != "" && groupID != undefined) {
CHAT_UI.refreshAllGroupSearch(groupID);
NativeBridgeDelegate.setToMoveGroupId("");
} else {
CHAT_UI.refreshContactScreen();
......
......@@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", function () {
});
ARCHIVE_UI.refreshSearchScreen = function (keyword) {
const archiveList = CHAT_DB.getArchiveByName(keyword);
const archiveList = NativeBridgeDataSource.getArchiveByName(keyword);
const typeImage = getArchiveTypeIconURL(archive.archiveType);
getArchiveTemplate().then(function (archiveTemplate) {
......
......@@ -18,17 +18,17 @@ CHAT_ADD_USER.searchUser = function (keyword) {
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword);
const groupList = NativeBridgeDataSource.getGroupByName(keyword);
searchGroupData(groupList, overlayMessage);
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
var userList = NativeBridgeDataSource.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
var userList = NativeBridgeDataSource.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0;
}
......
// ios用
function callNativeApp(iosKey, jsonData) {
console.log("callNativeApp called");
var result;
try {
var key = iosKey;
var data = jsonData;
var payload = { key: key, data: data };
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result = prompt(JSON.stringify(payload));
console.log(result);
} catch (err) {
console.log("The native context does not exist yet");
}
return result;
}
CHAT_DB.getBeforeRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
}
};
CHAT_DB.getRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
CHAT_DB.removeFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.getCollaborationJoinFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
}
};
CHAT_DB.getUserInfoList = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
}
};
CHAT_DB.createContentView = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
}
};
CHAT_DB.getToMoveGroupId = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
}
};
CHAT_DB.getJoinCollaborationType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
);
}
};
CHAT_DB.getHostRequestFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
}
};
// 名前空間
var CHAT_DB = {};
//ロカールDBからルーム一覧情報を取得
CHAT_DB.getRoomList = function (roomType, keyWord) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, {
roomType: roomType,
keyWord: keyWord,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getRoomList(roomType, keyWord));
}
};
CHAT_DB.callGetRoomList = function (roomType) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, { roomType: roomType })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
};
//ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB.getMyInfo = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyInfo, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyInfo());
}
};
CHAT_DB.getMessages = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessages, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMessageList(roomId));
}
};
CHAT_DB.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
};
CHAT_DB.getFavoriteUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getFavoriteUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
}
};
CHAT_DB.getFavoriteUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsers());
}
};
CHAT_DB.getFavoriteGroups = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteGroups, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteGroups());
}
};
CHAT_DB.getMyGroupUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyGroupUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsers());
}
};
CHAT_DB.getGroupInfo = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfo, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfo(groupId));
}
};
CHAT_DB.getGroupInfoForAddUser = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfoForAddUser, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
CHAT_DB.loadSelectedUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getSelectedUserList, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
console.log(JSON.parse(android.getSelectedUserList()));
return JSON.parse(android.getSelectedUserList());
}
};
CHAT_DB.getNameCardData = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getNameCardData, {
shopMemberId: shopMemberId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getNameCardData(shopMemberId));
}
};
CHAT_DB.getMyGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getMyGroupShopMemberNotInRoomByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getMyGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
CHAT_DB.getAllGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getAllGroupShopMemberNotInRoomByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getAllGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
CHAT_DB.getGroupByName = function (groupName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupByName, { groupName: groupName })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupByName(groupName));
}
};
CHAT_DB.getUsersInRoom = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUsersInRoom, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUsersInRoom(roomId));
}
};
// アーカイブ一覧
CHAT_DB.getArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getArchiveList, {}));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveList());
}
};
// アーカイブ一覧検索
CHAT_DB.getArchiveByName = function (archiveName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveByName, {
archiveName: archiveName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveListByName(archiveName));
}
};
// アーカイブ詳細
CHAT_DB.getArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveDetail, { archiveId: archiveId })
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveDetail(archiveId));
}
};
CHAT_DB.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.searchMessages(keyword, userList));
}
};
CHAT_DB.getMyGroupUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
}
};
CHAT_DB.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUserInfo(shopMemberId));
}
};
CHAT_DB.getUserListByLoginId = function (loginIdList) {
console.log(loginIdList);
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserListByLoginId, {
loginIdList: loginIdList.join(","),
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserListByLoginId(loginIdList.join(",")));
}
};
......@@ -14,7 +14,7 @@ window.onscroll = function () {
$("#messages").prepend(loader);
const messageId = $($(".chat_message").get(0)).data("messageid");
NativeBridgeDelegate.updatePreMessage(messageId);
let messages = CHAT_DB.getMessagesWithMessageId(messageId);
let messages = NativeBridgeDataSource.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages);
loader.remove();
var afterHeight = $(".room_container").height();
......
......@@ -45,7 +45,7 @@ CHAT_UI.refreshJoinedCollaboration = function (loginIdList) {
}
);
var joinedUserList = CHAT_DB.getUserListByLoginId(loginIdList);
var joinedUserList = NativeBridgeDataSource.getUserListByLoginId(loginIdList);
var sortedUserList = new Array();
loginIdList.forEach(function (userId) {
......@@ -98,7 +98,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName,
......@@ -109,7 +109,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
$("#favoriteListForAddUserInCollaboration").append(obj);
});
//お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsersNotInRoom();
var favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
......@@ -125,7 +125,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
let obj = jQuery.parseHTML(html);
$("#favoriteListForAddUserInCollaboration").append(obj);
var myGroupList = CHAT_DB.getMyGroupUsersNotInRoom();
var myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom();
myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -164,7 +164,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
$("#groupPathAreaForAddUserInCollaboration").html("");
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId);
var result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () {
......@@ -244,7 +244,7 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
return;
}
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId);
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
var namecardTemplate;
var changeHostTemplate;
......@@ -280,32 +280,22 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
CHAT_UI.removeFavoriteUserInCollaboration = function (shopMemberId) {
CHAT_UI.showLoadingIndicator();
$("#userNameCardInCollaboration").modal("hide");
var result;
if (typeof android != "undefined") {
result = android.removeFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.removeFavoriteUser(shopMemberId);
}
NativeBridgeDataSource.removeFavoriteUser(shopMemberId);
CHAT_UI.dismissLoadingIndicator();
};
CHAT_UI.insertFavoriteUserInCollaboration = function (shopMemberId) {
$("#userNameCardInCollaboration").modal("hide");
var result;
if (typeof android != "undefined") {
result = android.addFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.addFavoriteUser(shopMemberId);
}
NativeBridgeDataSource.addFavoriteUser(shopMemberId);
CHAT_UI.dismissLoadingIndicator();
};
CHAT_UI.confirmInviteUserListInCollaboration = function () {
var selectedUsers = CHAT_DB.loadSelectedUsers();
var selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html("");
var selectedUserList = CHAT_DB.loadSelectedUsers();
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
......
......@@ -10,8 +10,7 @@ $(window).on("resize", function () {
return;
}
console.log(`width : ${$(this).width()}`);
console.log(`height : ${$(this).height()}`);
console.log(`width : ${$(this).width()}` + `height : ${$(this).height()}`);
if (CHAT_UTIL.isIOS()) {
if (isLandscape == true) {
......@@ -810,7 +809,7 @@ CHAT_UI.refreshContactScreen = function () {
var groupUserTemplate = getTemplate(TemplateURL.GROUP_USER_LIST);
NativeBridgeDelegate.updateContactInfo();
var myInfo = CHAT_DB.getMyInfo();
var myInfo = NativeBridgeDataSource.getMyInfo();
myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl);
let myNamecardHtml = Mustache.render(myNamecardTemplate, {
......@@ -829,7 +828,7 @@ CHAT_UI.refreshContactScreen = function () {
$("#myImg").attr("src", myInfo.profileImagePath);
//お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName,
......@@ -841,7 +840,7 @@ CHAT_UI.refreshContactScreen = function () {
$("#favoriteList").append(obj);
});
//お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsers();
var favoriteUserList = NativeBridgeDataSource.getFavoriteUsers();
favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
favoriteUser.isFavorite = true;
......@@ -852,7 +851,7 @@ CHAT_UI.refreshContactScreen = function () {
let obj = jQuery.parseHTML(html);
$("#favoriteList").append(obj);
var myGroupList = CHAT_DB.getMyGroupUsers();
var myGroupList = NativeBridgeDataSource.getMyGroupUsers();
myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -874,12 +873,8 @@ CHAT_UI.refreshRoomList = function (roomType) {
} else {
CHAT_UI.refreshForOffline();
}
var beforeRoomType;
if (typeof android != "undefined") {
beforeRoomType = android.getBeforeRoomType();
} else {
beforeRoomType = CHAT_DB.getBeforeRoomType();
}
const beforeRoomType = NativeBridgeDataSource.getBeforeRoomType();
if (beforeRoomType != null) {
roomType = beforeRoomType;
NativeBridgeDelegate.clearBeforeRoomType();
......@@ -894,7 +889,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
if (IS_ONLINE == "true") {
NativeBridgeDelegate.updateRoomList();
}
var rooms = CHAT_DB.getRoomList(roomType, null);
var rooms = NativeBridgeDataSource.getRoomList(roomType, null);
CHAT.globalIsInvite = false;
// #36146に対応
$("#groupChatList").empty();
......@@ -1009,8 +1004,8 @@ CHAT_UI.loadMessages = function (roomId, joinRoomName) {
if (roomType == ChatRoomType.DM) {
$("#roomMenu").removeClass("none");
}
var messages = CHAT_DB.getMessages(roomId);
var usersInRoom = CHAT_DB.getUsersInRoom(roomId);
var messages = NativeBridgeDataSource.getMessages(roomId);
var usersInRoom = NativeBridgeDataSource.getUsersInRoom(roomId);
$("#roomTitle").text(roomName).data("roomName", roomName);
let jQueryMessages = $("#messages");
......@@ -1132,19 +1127,11 @@ CHAT_UI.prependMessage = function (messages) {
message.messageType == MessageType.COMMUNICATIONSTART ||
message.messageType == MessageType.COMMUNICATIONEND
) {
var collaborationInfo;
var userInCollaboration;
if (CHAT_UTIL.isIOS()) {
collaborationInfo = JSON.parse(message.message);
userInCollaboration = JSON.parse(
CHAT_DB.getUserInfoList(collaborationInfo.userList)
);
} else if (CHAT_UTIL.isAndroid()) {
collaborationInfo = JSON.parse(message.message);
userInCollaboration = JSON.parse(
android.getUserInfoList(collaborationInfo.userList)
);
}
const collaborationInfo = JSON.parse(message.message);
const userInCollaboration = JSON.parse(
NativeBridgeDataSource.getUserInfoList(collaborationInfo.userList)
);
var meetingId = 0;
if (typeof collaborationInfo.meetingId != "undefined") {
meetingId = collaborationInfo.meetingId;
......@@ -1225,18 +1212,13 @@ CHAT_UI.removeFavoriteUser = function (shopMemberId) {
CHAT_UI.showLoadingIndicator();
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
var result;
if (typeof android != "undefined") {
result = android.removeFavoriteUser(shopMemberId);
const result = NativeBridgeDataSource.removeFavoriteUser(shopMemberId);
if (result) {
$(".shopmember_" + shopMemberId).removeClass("active");
$(".shopmember_" + shopMemberId).addClass("disable");
} else {
result = CHAT_DB.removeFavoriteUser(shopMemberId);
}
if (!result) {
$(".shopmember_" + shopMemberId).addClass("active");
$(".shopmember_" + shopMemberId).removeClass("disable");
} else {
$(".shopmember_" + shopMemberId).removeClass("active");
$(".shopmember_" + shopMemberId).addClass("disable");
}
CHAT_UI.dismissLoadingIndicator();
};
......@@ -1244,20 +1226,13 @@ CHAT_UI.removeFavoriteUser = function (shopMemberId) {
CHAT_UI.insertFavoriteUser = function (shopMemberId) {
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
var result;
if (typeof android != "undefined") {
result = android.addFavoriteUser(shopMemberId);
const result = NativeBridgeDataSource.addFavoriteUser(shopMemberId);
if (result) {
$(".shopmember_" + shopMemberId).removeClass("disable");
$(".shopmember_" + shopMemberId).addClass("active");
} else {
result = CHAT_DB.addFavoriteUser(shopMemberId);
}
if (!result) {
$(".shopmember_" + shopMemberId).addClass("disable");
$(".shopmember_" + shopMemberId).removeClass("active");
CHAT_UI.dismissLoadingIndicator();
return;
} else {
$(".shopmember_" + shopMemberId).removeClass("disable");
$(".shopmember_" + shopMemberId).addClass("active");
}
CHAT_UI.dismissLoadingIndicator();
};
......@@ -1322,7 +1297,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
$("#groupPathArea").html("");
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfo(groupId);
var result = NativeBridgeDataSource.getGroupInfo(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
......@@ -1419,7 +1394,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
return;
}
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId);
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
var namecardTemplate = getTemplate(TemplateURL.USER_NAME_CARD);
nameCardInfo.profileUrl = CHAT.getProfileImgUrl(nameCardInfo.profileUrl);
......@@ -1462,10 +1437,10 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
NativeBridgeDelegate.updateArchiveDetail(archiveId);
}
// アーカイブ詳細取得
const archive = CHAT_DB.getArchiveDetail(archiveId);
const archive = NativeBridgeDataSource.getArchiveDetail(archiveId);
// 保存ユーザ情報を取得
const userInfo = CHAT_DB.getUserInfo(archive.saveUserId);
const userInfo = NativeBridgeDataSource.getUserInfo(archive.saveUserId);
userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl);
// アーカイブ情報を表示
......@@ -1558,7 +1533,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
if (user == "") {
return;
}
var userInfo = CHAT_DB.getUserInfo(user);
var userInfo = NativeBridgeDataSource.getUserInfo(user);
userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl);
const html = Mustache.render(archiveUserTemplate, {
profileImage: userInfo.profileUrl,
......@@ -1603,7 +1578,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () {
NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName,
......@@ -1614,7 +1589,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () {
$("#favoriteListForMakeRoom").append(obj);
});
//お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsers();
var favoriteUserList = NativeBridgeDataSource.getFavoriteUsers();
favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
......@@ -1630,7 +1605,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () {
let obj = jQuery.parseHTML(html);
$("#favoriteListForMakeRoom").append(obj);
var myGroupList = CHAT_DB.getMyGroupUsers();
var myGroupList = NativeBridgeDataSource.getMyGroupUsers();
myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -1673,7 +1648,7 @@ CHAT_UI.refreshAllGroupForMakeRoom = function (paramGroupId) {
$("#groupPathAreaForMakeRoom").html("");
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfo(groupId);
var result = NativeBridgeDataSource.getGroupInfo(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
......@@ -1791,7 +1766,7 @@ CHAT_UI.refreshArchiveScreen = function () {
}
// ローカルDBのデータを表示
var archiveList = CHAT_DB.getArchiveList();
var archiveList = NativeBridgeDataSource.getArchiveList();
if (typeof archiveList == "undefined") {
CHAT_UI.dismissLoadingIndicator();
return;
......@@ -1834,7 +1809,7 @@ CHAT_UI.showMakeRoomConfirmView = function () {
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_CONFIRM_USER_LIST);
var selectedUserList = CHAT_DB.loadSelectedUsers();
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) {
let html = Mustache.render(userTemplate, {
......@@ -1955,7 +1930,7 @@ CHAT_UI.showAddUserConfirmView = function () {
$("#selectedUserList").html("");
var userTemplate = getTemplate(TemplateURL.ADD_USER_CONFIRM_USER_LIST);
var selectedUserList = CHAT_DB.loadSelectedUsers();
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) {
let html = Mustache.render(userTemplate, {
......@@ -1997,7 +1972,7 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName,
......@@ -2008,7 +1983,7 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
$("#favoriteListForMakeRoom").append(obj);
});
//お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsersNotInRoom();
var favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
......@@ -2024,7 +1999,7 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
let obj = jQuery.parseHTML(html);
$("#favoriteListForMakeRoom").append(obj);
var myGroupList = CHAT_DB.getMyGroupUsersNotInRoom();
var myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom();
myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -2067,7 +2042,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
$("#groupPathAreaForAddUser").html("");
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId);
var result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
......@@ -2182,7 +2157,7 @@ CHAT_UI.refreshForOffline = function () {
alert(alertString);
NativeBridgeDelegate.finishCollaboration();
if (collaborationJoinFlg != "2") {
NativeBridgeDelegate.joinRoom(
CHAT.globalLoginParameter.roomId,
......@@ -2202,4 +2177,4 @@ CHAT_UI.displayExistRoom = function (roomId) {
NativeBridgeDelegate.joinRoom(roomId);
}
return;
};
\ No newline at end of file
};
......@@ -140,10 +140,8 @@ CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
) {
switch (joinCollaborationType) {
case COLLABORATION_TYPE.AUDIO:
console.log(CollaborationTypeKey.AUDIO);
return CollaborationTypeKey.AUDIO;
case COLLABORATION_TYPE.CAMERA:
console.log(CollaborationTypeKey.CAMERA);
return CollaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return CollaborationTypeKey.VIDEO;
......
......@@ -570,7 +570,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (keyword.length == 1) {
return;
}
const messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(","));
const messages = NativeBridgeDataSource.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
......@@ -631,7 +631,7 @@ var getCheckedUserList = function () {
CHAT.searchRoom = function (keyword, rooms) {
const overlayMessage = $(".overlay_src_msg");
overlayMessage.empty();
rooms = CHAT_DB.getRoomList(ChatRoomType.ALL, keyword);
rooms = NativeBridgeDataSource.getRoomList(ChatRoomType.ALL, keyword);
let roomListTitle = getLocalizedString("room_search_placeholder");
$("#chatTitle").text(roomListTitle);
......@@ -716,7 +716,7 @@ CHAT.searchMessage = function (keyword, workVal) {
const selectedUser = $(".img_wrap.filter")[user];
checkedUserList.push($(selectedUser).data("user-id"));
});
var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(","));
var messages = NativeBridgeDataSource.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
......
......@@ -19,7 +19,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupList = NativeBridgeDataSource.getGroupByName(keyword);
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
......@@ -29,7 +29,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
});
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
......@@ -38,7 +38,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
hasNoData = groupList.length == 0 && userList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
......
// ios用
function callNativeApp(iosKey, jsonData) {
console.log("callNativeApp called: "+iosKey);
var result;
try {
var key = iosKey;
var data = jsonData;
var payload = { key: key, data: data };
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result = prompt(JSON.stringify(payload));
} catch (err) {
console.log("The native context does not exist yet");
}
return result;
}
var NativeBridgeDataSource = {};
// todo: peacekim:: it should be datasource
NativeBridgeDataSource.removeFavoriteGroup = function (groupID) {
if (CHAT_UTIL.isIOS()) {
const result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
......@@ -34,3 +50,400 @@ NativeBridgeDataSource.getRoomType = function () {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
//ロカールDBからルーム一覧情報を取得
NativeBridgeDataSource.getRoomList = function (roomType, keyWord) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, {
roomType: roomType,
keyWord: keyWord,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getRoomList(roomType, keyWord));
}
};
NativeBridgeDataSource.callGetRoomList = function (roomType) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, { roomType: roomType })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
};
//ロカールDBからログインしたユーザのデータを取得する。
NativeBridgeDataSource.getMyInfo = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyInfo, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyInfo());
}
};
NativeBridgeDataSource.getMessages = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessages, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMessageList(roomId));
}
};
NativeBridgeDataSource.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
};
NativeBridgeDataSource.getFavoriteUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getFavoriteUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
}
};
NativeBridgeDataSource.getFavoriteUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsers());
}
};
NativeBridgeDataSource.getFavoriteGroups = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteGroups, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteGroups());
}
};
NativeBridgeDataSource.getMyGroupUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyGroupUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsers());
}
};
NativeBridgeDataSource.getGroupInfo = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfo, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfo(groupId));
}
};
NativeBridgeDataSource.getGroupInfoForAddUser = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfoForAddUser, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
NativeBridgeDataSource.loadSelectedUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getSelectedUserList, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
console.log(JSON.parse(android.getSelectedUserList()));
return JSON.parse(android.getSelectedUserList());
}
};
NativeBridgeDataSource.getNameCardData = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getNameCardData, {
shopMemberId: shopMemberId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getNameCardData(shopMemberId));
}
};
NativeBridgeDataSource.getMyGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberByName(shopMemberName));
}
};
NativeBridgeDataSource.getMyGroupShopMemberNotInRoomByName = function (
shopMemberName
) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getMyGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
NativeBridgeDataSource.getAllGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberByName(shopMemberName));
}
};
NativeBridgeDataSource.getAllGroupShopMemberNotInRoomByName = function (
shopMemberName
) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getAllGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
NativeBridgeDataSource.getGroupByName = function (groupName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupByName, { groupName: groupName })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupByName(groupName));
}
};
NativeBridgeDataSource.getUsersInRoom = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUsersInRoom, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUsersInRoom(roomId));
}
};
// アーカイブ一覧
NativeBridgeDataSource.getArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getArchiveList, {}));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveList());
}
};
// アーカイブ一覧検索
NativeBridgeDataSource.getArchiveByName = function (archiveName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveByName, {
archiveName: archiveName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveListByName(archiveName));
}
};
// アーカイブ詳細
NativeBridgeDataSource.getArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveDetail, { archiveId: archiveId })
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveDetail(archiveId));
}
};
NativeBridgeDataSource.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.searchMessages(keyword, userList));
}
};
NativeBridgeDataSource.getMyGroupUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
}
};
NativeBridgeDataSource.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUserInfo(shopMemberId));
}
};
NativeBridgeDataSource.getUserListByLoginId = function (loginIdList) {
console.log(loginIdList);
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserListByLoginId, {
loginIdList: loginIdList.join(","),
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserListByLoginId(loginIdList.join(",")));
}
};
NativeBridgeDataSource.getBeforeRoomType = function () {
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
} else {
return android.getBeforeRoomType();
}
};
NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
} else {
return android.removeFavoriteUser(shopMemberId);
}
};
NativeBridgeDataSource.addFavoriteUser = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
} else {
return android.addFavoriteUser(shopMemberId);
}
};
NativeBridgeDataSource.getJoinCollaborationType = function () {
if (CHAT_UTIL.isIOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
);
} else {
return android.getJoinCollaborationType();
}
};
NativeBridgeDataSource.getCollaborationJoinFlg = function () {
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
} else {
return android.getCollaborationJoinFlg();
}
};
NativeBridgeDataSource.getUserInfoList = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
} else {
return android.getUserInfoList(collaborationInfo.userList);
}
};
NativeBridgeDataSource.createContentView = function () {
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
} else {
return android.createContentView();
}
};
NativeBridgeDataSource.getToMoveGroupId = function () {
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
} else {
return android.getToMoveGroupId();
}
};
NativeBridgeDataSource.getHostRequestFlg = function () {
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
} else {
return android.getHostRequestFlg();
}
};
\ No newline at end of file
......@@ -19,17 +19,17 @@ CONTACT.searchUser = function (keyword) {
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword);
const groupList = NativeBridgeDataSource.getGroupByName(keyword);
groupDataSearch(groupList);
//ユーザデータ検索
const userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
const userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0;
......
......@@ -414,11 +414,7 @@ document.addEventListener("DOMContentLoaded", function () {
globalUserInfo.coWorkType
);
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
meetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
meetingId = android.createContentView();
}
meetingId = NativeBridgeDataSource.createContentView();
joinMeetingId = meetingId;
}
} else if (collaborationJoinFlg == "2") {
......@@ -571,12 +567,7 @@ function changeCollaboration(changeCollaborationType) {
break;
case COLLABORATION_TYPE.DOCUMENT:
coview_api.ChangeCollaboration("audio");
if (CHAT_UTIL.isIOS()) {
newMeetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
newMeetingId = android.createContentView();
console.log("newMeetingId = " + newMeetingId);
}
newMeetingId = NativeBridgeDataSource.createContentView();
break;
case COLLABORATION_TYPE.BOARD:
coview_api.ChangeCollaboration("audio");
......@@ -742,12 +733,7 @@ function applyForHostChange() {
alert(getLocalizedString("not_support_version"));
return;
}
var hostRequestFlg = 0;
if (CHAT_UTIL.isAndroid()) {
hostRequestFlg = android.getHostRequestFlg();
} else {
hostRequestFlg = CHAT_DB.getHostRequestFlg();
}
const hostRequestFlg = NativeBridgeDataSource.getHostRequestFlg();
if (hostRequestFlg == HostRequestFlag.DOING) {
alert(getLocalizedString("already_processing_host_request"));
return;
......
......@@ -59,7 +59,7 @@ var addCollaborationMessage = function (
) {
const collaborationType = messageInfo[2];
const meetingID = getMeetingID(collaborationType, messageInfo);
const userInCollaboration = getUserInfoList(userID);
const userInCollaboration = JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
......@@ -120,7 +120,9 @@ var renderCollaborationMessage = function (
var addTextMessage = function (messageText, message, socketID) {
const messageTextWithSID = insertSID(messageText);
const messageSender = getUserInfoList(message.userId);
const messageSender = JSON.parse(
NativeBridgeDataSource.getUserInfoList(message.userId)
);
const shopMemberName = messageSender[0].shopMemberName;
const textMessageTemplate = getTextMessageTemplate(message.id === socketID);
const profileImagePath = CHAT.getProfileImgUrl(message.profileImagePath);
......@@ -164,11 +166,7 @@ var renderTextMessage = function (
};
var getUserInfoList = function (userID) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(CHAT_DB.getUserInfoList(userID));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserInfoList(userID));
}
return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
};
var cleanUpCollaborationMessage = function () {
......
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