Commit 8c77c525 by Lee Munkyeong

オフライン対応

parent 259e877d
...@@ -15,7 +15,8 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -15,7 +15,8 @@ import jp.agentec.adf.util.DateTimeUtil;
public class RoomListJSON extends AcmsCommonJSON { public class RoomListJSON extends AcmsCommonJSON {
private static final String Body = "body"; private static final String Body = "body";
private static final String ChatRoomInfoList = "chatRoomInfoList"; private static final String ChatRoomInfoList = "chatRoomInfoList";
private static final String MessageInsertDate = "messageInsertDate"; private static final String InsertDate = "insertDate";
private static final String Time = "time";
private static final String RoomId = "roomId"; private static final String RoomId = "roomId";
private static final String RoomName = "roomName"; private static final String RoomName = "roomName";
private static final String RoomType = "roomType"; private static final String RoomType = "roomType";
...@@ -57,21 +58,13 @@ public class RoomListJSON extends AcmsCommonJSON { ...@@ -57,21 +58,13 @@ public class RoomListJSON extends AcmsCommonJSON {
//最後メッセージ情報がある場合の処理 //最後メッセージ情報がある場合の処理
JSONObject lastMessageInfoJSON = roomListJsonArray.getJSONObject(listCount).has(LastMessageInfo) ? roomListJsonArray.getJSONObject(listCount).getJSONObject(LastMessageInfo) : null; JSONObject lastMessageInfoJSON = roomListJsonArray.getJSONObject(listCount).has(LastMessageInfo) ? roomListJsonArray.getJSONObject(listCount).getJSONObject(LastMessageInfo) : null;
if (lastMessageInfoJSON != null) { if (lastMessageInfoJSON != null && lastMessageInfoJSON.has(MessageId)) {
chatMessageDto.chatRoomId = chatRoomDto.chatRoomId; chatMessageDto.chatRoomId = chatRoomDto.chatRoomId;
chatMessageDto.message = lastMessageInfoJSON.getString(Message); chatMessageDto.message = lastMessageInfoJSON.getString(Message);
chatMessageDto.messageType = lastMessageInfoJSON.getInt(MessageType); chatMessageDto.messageType = lastMessageInfoJSON.getInt(MessageType);
if (lastMessageInfoJSON.has(InsertDate)) {
lastMessageInfoJSON.getJSONObject(MessageInsertDate); chatMessageDto.insertDate = DateTimeUtil.millToDateString(lastMessageInfoJSON.getJSONObject(InsertDate).getLong(Time));
//TODO Change InsertDate Type
chatMessageDto.insertDate = lastMessageInfoJSON.getString(MessageInsertDate);
if (lastMessageInfoJSON.has(MessageInsertDate)) {
chatMessageDto.insertDate = DateTimeUtil.toDate(lastMessageInfoJSON.getString(MessageInsertDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
} }
chatMessageDto.shopMemberId = lastMessageInfoJSON.getInt(ShopMemberId); chatMessageDto.shopMemberId = lastMessageInfoJSON.getInt(ShopMemberId);
chatMessageDto.chatMessageId = lastMessageInfoJSON.getInt(MessageId); chatMessageDto.chatMessageId = lastMessageInfoJSON.getInt(MessageId);
chatRoomDto.lastMessageInfo = chatMessageDto; chatRoomDto.lastMessageInfo = chatMessageDto;
......
...@@ -67,7 +67,7 @@ public class ChatMessageDao extends AbstractDao { ...@@ -67,7 +67,7 @@ public class ChatMessageDao extends AbstractDao {
} }
public void insertChatMessage(ChatMessageDto dto) { public void insertChatMessage(ChatMessageDto dto) {
insert("insert into t_chat_message (chat_message_id, chat_room_id, shop_member_id, message, message_type, image_name, download_file_name, save_path, insert_date) values (?,?,?,?,?,?,?,?)", dto.getInsertValues()); insert("insert into t_chat_message (chat_message_id, chat_room_id, shop_member_id, message, message_type, image_name, download_file_name, save_path, insert_date) values (?,?,?,?,?,?,?,?,?)", dto.getInsertValues());
} }
public boolean updateChatMessage(ChatMessageDto dto) { public boolean updateChatMessage(ChatMessageDto dto) {
......
...@@ -80,6 +80,7 @@ public class ChatRoomDao extends AbstractDao { ...@@ -80,6 +80,7 @@ public class ChatRoomDao extends AbstractDao {
sql.append(" ( SELECT max(insert_date) insert_date, message, message_type, chat_room_id FROM t_chat_message GROUP BY chat_room_id ) AS cm "); sql.append(" ( SELECT max(insert_date) insert_date, message, message_type, chat_room_id FROM t_chat_message GROUP BY chat_room_id ) AS cm ");
sql.append(" ON cr.chat_room_id = cm.chat_room_id "); sql.append(" ON cr.chat_room_id = cm.chat_room_id ");
sql.append(" GROUP BY cr.chat_room_id "); sql.append(" GROUP BY cr.chat_room_id ");
sql.append(" ORDER BY cm.insert_date DESC ");
List<ChatRoomDto> list = rawQueryGetDtoList(sql.toString(), null, ChatRoomDto.class); List<ChatRoomDto> list = rawQueryGetDtoList(sql.toString(), null, ChatRoomDto.class);
return list; return list;
} }
...@@ -93,7 +94,7 @@ public class ChatRoomDao extends AbstractDao { ...@@ -93,7 +94,7 @@ public class ChatRoomDao extends AbstractDao {
} }
public void insertChatRoom(ChatRoomDto dto) { public void insertChatRoom(ChatRoomDto dto) {
insert("insert into t_chat_room (chat_room_id, chat_room_name, type, unread_count, user_count, favorite_register_date) values (?,?,?,?)", dto.getInsertValues()); insert("insert into t_chat_room (chat_room_id, chat_room_name, type, unread_count, user_count, favorite_register_date) values (?,?,?,?,?,?)", dto.getInsertValues());
} }
public boolean updateChatRoom(ChatRoomDto dto) { public boolean updateChatRoom(ChatRoomDto dto) {
......
...@@ -19,7 +19,7 @@ public class MShopMember extends SQLiteTableScript { ...@@ -19,7 +19,7 @@ public class MShopMember extends SQLiteTableScript {
sql.append(" shop_member_id INTEGER NOT NULL "); sql.append(" shop_member_id INTEGER NOT NULL ");
sql.append(" , shop_member_name VARCHAR(64) "); sql.append(" , shop_member_name VARCHAR(64) ");
sql.append(" , profile_url VARCHAR(64) "); sql.append(" , profile_url VARCHAR(64) ");
sql.append(" , favorite_register_date DATETIME "); sql.append(" , favorite_register_date VARCHAR2(64) ");
sql.append(" , PRIMARY KEY (shop_member_id) "); sql.append(" , PRIMARY KEY (shop_member_id) ");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -24,7 +24,7 @@ public class TChatMessage extends SQLiteTableScript { ...@@ -24,7 +24,7 @@ public class TChatMessage extends SQLiteTableScript {
sql.append(" , image_name VARCHAR2 "); sql.append(" , image_name VARCHAR2 ");
sql.append(" , download_file_name VARCHAR2 "); sql.append(" , download_file_name VARCHAR2 ");
sql.append(" , save_path VARCHAR2 "); sql.append(" , save_path VARCHAR2 ");
sql.append(" , insert_date DATETIME"); sql.append(" , insert_date VARCHAR2(64)");
sql.append(" , PRIMARY KEY (chat_message_id) "); sql.append(" , PRIMARY KEY (chat_message_id) ");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -21,7 +21,7 @@ public class TChatRoom extends SQLiteTableScript { ...@@ -21,7 +21,7 @@ public class TChatRoom extends SQLiteTableScript {
sql.append(" , type INTEGER NOT NULL "); sql.append(" , type INTEGER NOT NULL ");
sql.append(" , unread_count INTEGER "); sql.append(" , unread_count INTEGER ");
sql.append(" , user_count INTEGER "); sql.append(" , user_count INTEGER ");
sql.append(" , favorite_register_date DATETIME "); sql.append(" , favorite_register_date VARCHAR2(64) ");
sql.append(" , PRIMARY KEY (chat_room_id) "); sql.append(" , PRIMARY KEY (chat_room_id) ");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -11,10 +11,11 @@ public class ChatMessageDto extends AbstractDto { ...@@ -11,10 +11,11 @@ public class ChatMessageDto extends AbstractDto {
public String imageName; public String imageName;
public String downloadFileName; public String downloadFileName;
public String savePath; public String savePath;
public Date insertDate; public String insertDate;
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
Object[] test = new Object[]{chatMessageId, chatRoomId, shopMemberId, message, messageType, imageName, downloadFileName, savePath, insertDate};
return new Object[]{chatMessageId, chatRoomId, shopMemberId, message, messageType, imageName, downloadFileName, savePath, insertDate}; return new Object[]{chatMessageId, chatRoomId, shopMemberId, message, messageType, imageName, downloadFileName, savePath, insertDate};
} }
......
...@@ -8,12 +8,12 @@ public class ChatRoomDto extends AbstractDto { ...@@ -8,12 +8,12 @@ public class ChatRoomDto extends AbstractDto {
public Integer chatRoomId; public Integer chatRoomId;
public String chatRoomName; public String chatRoomName;
public Integer type; public Integer type;
public Date favoriteRegisterDate; public String favoriteRegisterDate = "";
public Integer unreadCount; public Integer unreadCount;
public Integer userCount; public Integer userCount;
public String message; public String message;
public Integer messageType; public Integer messageType;
public Date insertDate; public String insertDate;
public ChatMessageDto lastMessageInfo; public ChatMessageDto lastMessageInfo;
@Override @Override
......
...@@ -6,7 +6,7 @@ public class ShopMemberDto extends AbstractDto { ...@@ -6,7 +6,7 @@ public class ShopMemberDto extends AbstractDto {
public Integer shopMemberId; public Integer shopMemberId;
public String shopMemberName; public String shopMemberName;
public String profileUrl; public String profileUrl;
public Date favoriteRegisterDate; public String favoriteRegisterDate;
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
......
...@@ -88,9 +88,11 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -88,9 +88,11 @@ public class CommunicationLogic extends AbstractLogic {
public void insertChatRoomList(List<ChatRoomDto> roomList) { public void insertChatRoomList(List<ChatRoomDto> roomList) {
for (ChatRoomDto chatRoomDto : roomList) { for (ChatRoomDto chatRoomDto : roomList) {
chatRoomDao.insertChatRoom(chatRoomDto); chatRoomDao.insertChatRoom(chatRoomDto);
if (chatRoomDto.lastMessageInfo != null) {
chatMessageDao.insertChatMessage(chatRoomDto.lastMessageInfo); chatMessageDao.insertChatMessage(chatRoomDto.lastMessageInfo);
} }
} }
}
public void deleteChatRoomList() { public void deleteChatRoomList() {
chatRoomDao.deleteChatRoom(); chatRoomDao.deleteChatRoom();
......
...@@ -584,4 +584,13 @@ public class DateTimeUtil { ...@@ -584,4 +584,13 @@ public class DateTimeUtil {
return calendar1.before(calendar2); return calendar1.before(calendar2);
} }
public static String millToDateString(long mills) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date timeInDate = new Date(mills);
String timeInFormat = sdf.format(timeInDate);
return timeInFormat;
}
} }
...@@ -23,15 +23,11 @@ ...@@ -23,15 +23,11 @@
let IS_ONLINE = false; let IS_ONLINE = false;
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
console.log('TEST get GP');
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl; CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
console.log(CHAT_SERVER_URL);
console.log(CMS_SERVER_URL);
console.log(isOnline);
}; };
android.getGlobalParameter(); android.getGlobalParameter();
......
...@@ -50,9 +50,7 @@ $('#createChatRoom').on('click', function(){ ...@@ -50,9 +50,7 @@ $('#createChatRoom').on('click', function(){
let isInvite = false; let isInvite = false;
CHAT.globalIsInvite = isInvite; CHAT.globalIsInvite = isInvite;
CHAT_UI.loadInviteScreen(isInvite); socket.emit('getGroupList', isInvite);
//socket.emit('getGroupList', isInvite);
}); });
// Room Delete // Room Delete
...@@ -769,9 +767,7 @@ CHAT_UI.waitForLoadingImage = function(div, callback) { ...@@ -769,9 +767,7 @@ CHAT_UI.waitForLoadingImage = function(div, callback) {
} }
CHAT_UI.refreshRoomList = function() { CHAT_UI.refreshRoomList = function() {
var rooms = CHAT_DB.getRoomList(); var rooms = CHAT_DB.getRoomList();
console.log(rooms);
CHAT.globalIsInvite = false; CHAT.globalIsInvite = false;
activeRoomId = null; activeRoomId = null;
// #36146に対応 // #36146に対応
...@@ -794,7 +790,7 @@ CHAT_UI.refreshRoomList = function() { ...@@ -794,7 +790,7 @@ CHAT_UI.refreshRoomList = function() {
} }
// チャットルームの様式を読み込む // チャットルームの様式を読み込む
const template = $('#room-template').html(); const template = $('#room-template').html();
rooms.forEach( function(room) { rooms.forEach(function(room) {
room.profileImagePath = ASSET_PATH + 'images/user-profile.png' room.profileImagePath = ASSET_PATH + 'images/user-profile.png'
if (room.message) { if (room.message) {
room.message = room.message.toString() room.message = room.message.toString()
...@@ -803,46 +799,27 @@ CHAT_UI.refreshRoomList = function() { ...@@ -803,46 +799,27 @@ CHAT_UI.refreshRoomList = function() {
} }
var displayMsg; var displayMsg;
//TODO 協業の場合処理追加必要 //TODO 協業の場合処理追加必要
if (room.messageType == 0 || room.messageType == 3) displayMsg = room.message; if (room.messageType == messageType.TEXT || room.messageType == messageType.TEXT) displayMsg = room.message;
if (room.messageType == 1 || room.messageType == 2) displayMsg = getLocalizedString("image"); if (room.messageType == messageType.IMAGE || room.messageType == messageType.SYSTEM) displayMsg = getLocalizedString("image");
console.log(displayMsg);
let html = Mustache.render(template, { let html = Mustache.render(template, {
roomName: room.chatRoomName, roomName: room.chatRoomName,
roomId: room.chatRoomId, roomId: room.chatRoomId,
profileImage: room.profileImagePath, profileImage: room.profileImagePath,
active: activeRoomId === room.chatRoomId ? 'active_chat' : null, // 現在、入っているルームだとhilight表示 active: activeRoomId === room.chatRoomId ? 'active_chat' : null, // 現在、入っているルームだとhilight表示
lastMessage: displayMsg , lastMessage: displayMsg ,
time: '', time: room.insertDate ? CHAT_UTIL.formatDate(room.insertDate).createdAt : '',
unreadMsgCnt: room.unreadCount, unreadMsgCnt: room.unreadCount == 0 ? '' : room.unreadCount,
userCnt: room.userCount userCnt: room.userCount
}); });
console.log('TestPoint1');
// Click event // Click event
let obj = $(jQuery.parseHTML(html)).on('click',function(){ let obj = $(jQuery.parseHTML(html)).on('click', function() {
/*if (activeRoomId === room.roomId) { //TODO ルームに入る処理追加必要
// 既存チャットルームをタッチする場合、チャット画面に遷移
$('#pills-chat-tab').tab('show');
} else {
// loadingIndicatorを表示しない
CHAT_UI.showLoadingIndicator();
// 新しいチャットルームをタッチする場合、チャットルームの接続処理を実行
socket.emit('joinRoom', room.roomId, room.roomName, function (){
CHAT.saveRoomInfo(room.roomId, room.roomName);
$('#messages').html('');
// チャットルーム名を変更する
$('.titleRoomName').text(room.roomName).data('roomName', room.roomName);
});
}*/
}); });
// チャットルームリストに追加する // チャットルームリストに追加する
$('#room_list').append(obj); $('#room_list').append(obj);
}); });
console.log('TestPoint2'); if (rooms.length > 0) {
if(rooms.length > 0) { if (!keywordSearchMode) {
console.log('TestPoint3');
if(!keywordSearchMode) {
$(".roomListIcon").show() $(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').show() $('#roomDeleteButton, #arrangeRooms').show()
} else { } else {
...@@ -850,94 +827,22 @@ CHAT_UI.refreshRoomList = function() { ...@@ -850,94 +827,22 @@ CHAT_UI.refreshRoomList = function() {
$('#roomDeleteButton, #arrangeRooms').hide() $('#roomDeleteButton, #arrangeRooms').hide()
} }
} else { } else {
console.log('TestPoint4'); if (!keywordSearchMode) {
if(!keywordSearchMode) {
$(".roomListIcon").hide() $(".roomListIcon").hide()
} else { } else {
$(".roomListIcon").show() $(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').hide() $('#roomDeleteButton, #arrangeRooms').hide()
} }
} }
console.log('TestPoint5');
$('#createChatRoom').show(); $('#createChatRoom').show();
console.log($('#createChatRoom')); if (CHAT_UI.isLandscapeMode()) {
if(CHAT_UI.isLandscapeMode()) {
$(".chat_list").removeClass("col-12").addClass("col-6"); $(".chat_list").removeClass("col-12").addClass("col-6");
} }
$("#userSelectionDeleteBtn").hide(); $("#userSelectionDeleteBtn").hide();
// チャットルームリスト画面に遷移 // チャットルームリスト画面に遷移
$('#pills-chatlist-tab').tab('show'); $('#pills-chatlist-tab').tab('show');
// loadingIndicatorを表示しない
console.log('TestPoint6');
// loadingIndicatorを表示しない
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
CHAT_UI.loadInviteScreen = function(isInvite){
var groups = [];
$('#group_list').html('');
const template = $('#group-template').html();
if (groups.length === 0) {
$('#group_list').append('<center class="text-secondary">'+ getLocalizedString('everyoneIsHere') +'</center>');
}
// グループ名と人数を表記する。
groups.forEach( function(group) {
let html = Mustache.render(template, {
name: group.groupName,
info: group.memberCnt + getLocalizedString("people")
});
// グループをクリックすると、該当グループのユーザーリストを読み込むようにイベントを与える
let obj = $(jQuery.parseHTML(html)).on('click',function(){
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
//TODO ソケットでなくローカルDBより画面を構成するように修正必要。
//socket.emit('getUserListInGroup', group.groupId, isInvite);
$('#groupName').text(group.groupName);
});
$('#group_list').append(obj);
});
// Rotate
if(CHAT_UI.isLandscapeMode()) {
$(".group_list").addClass("col-6").removeClass("col-12");
}
// Set Title
let memberSelectTitle = getLocalizedString("groupSearch")
$('#pills-group-tab').tab('show');
$('#backButton').show();
if (isInvite) {
$('.titleRoomName').text(memberSelectTitle);
$('#newRoomName, .roomListIcon, .chatRoomIcon').hide();
$('#userSelectionConfirmBtn').show();
$("#userSelectionConfirmBtn").off().on('click', function(){
CHAT_UI.setConfirmButtonEvent(isInvite);
});
} else {
$('.titleRoomName').text(memberSelectTitle);
$('.roomListIcon, .chatRoomIcon, #newRoomName').hide();
$('#userSelectionConfirmBtn').show();
$("#userSelectionConfirmBtn").off().on('click', function(){
CHAT_UI.setConfirmButtonEvent(isInvite);
});
}
if (CHAT.globalSelectedUserList.length > 0) {
$('#userSelectionLength').text(CHAT.globalSelectedUserList.length);
} else {
$('#userSelectionLength').text('');
}
$('#backButton').off().on('click', function() {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
if (isInvite) {
$('#pills-chat-tab').tab('show');
} else {
CHAT_UI.refreshRoomList();
}
});
};
\ No newline at end of file
console.log('isOnlineRead');
console.log(IS_ONLINE);
var socket; var socket;
connectSocket(IS_ONLINE); connectSocket(IS_ONLINE);
function connectSocket(isOnline) { function connectSocket(isOnline) {
console.log(isOnline);
if (isOnline == 'true') { if (isOnline == 'true') {
socket = io(CHAT_SERVER_URL); socket = io(CHAT_SERVER_URL);
setSocketAction(); setSocketAction();
android.updateRoomList(); android.updateRoomList();
CHAT_UI.refreshRoomList(); CHAT_UI.refreshRoomList();
CHAT_UI.dismissLoadingIndicator();
$('#createChatRoom').show(); $('#createChatRoom').show();
} else { } else {
//オフラインの場合、DBからルーム一覧を表示。 //オフラインの場合、DBからルーム一覧を表示。
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOSの場合 //TODO IOSの場合
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
$('.overlay').removeClass('active undismissable'); $('.overlay').removeClass('active undismissable');
// loadingIndicatorを表示 // loadingIndicatorを表示
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
// チャットルームに入場する際、sid, loginId, shopName, roomId, roomNameの情報を取得しNodeJsに渡す
android.getLoginParameter(); android.getLoginParameter();
CHAT_UI.refreshRoomList(); CHAT_UI.refreshRoomList();
CHAT_UI.dismissLoadingIndicator();
$('#createChatRoom').show(); $('#createChatRoom').show();
} }
} }
...@@ -37,7 +32,6 @@ function connectSocket(isOnline) { ...@@ -37,7 +32,6 @@ function connectSocket(isOnline) {
* --------------------------------------------------- */ * --------------------------------------------------- */
function setSocketAction () { function setSocketAction () {
socket.on('connect', function (){ socket.on('connect', function (){
console.log('connect');
// socketが接続されたらチャット画面で画面を更新する // socketが接続されたらチャット画面で画面を更新する
$('.overlay').removeClass('active undismissable'); $('.overlay').removeClass('active undismissable');
// loadingIndicatorを表示 // loadingIndicatorを表示
...@@ -48,6 +42,7 @@ function setSocketAction () { ...@@ -48,6 +42,7 @@ function setSocketAction () {
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.getLoginParameter(); android.getLoginParameter();
} }
CHAT_UI.dismissLoadingIndicator();
}); });
socket.on('disconnect', function (){ socket.on('disconnect', function (){
...@@ -60,17 +55,6 @@ function setSocketAction () { ...@@ -60,17 +55,6 @@ function setSocketAction () {
socket.on('connect_error', function (){ socket.on('connect_error', function (){
console.log('connect_error'); console.log('connect_error');
// $('.overlay').addClass('active undismissable');
// #36174
// $("#customAlertTitle").text(getLocalizedString("errorConnect"));
// $("#customAlertOk").text(getLocalizedString("yesTitle"));
//
// $('#customAlert').appendTo("body").modal({
// backdrop: 'static',
// keyboard: false
// })
// .on('click', '#customAlertOk', function(e) {
// });
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}); });
...@@ -81,7 +65,8 @@ function setSocketAction () { ...@@ -81,7 +65,8 @@ function setSocketAction () {
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
// Update Room List // Update Room List
socket.on('refreshRoomList--', function(rooms, activeRoomId = null){ //TODO APIの連動が終わったら削除予定
/*socket.on('refreshRoomList', function(rooms, activeRoomId = null){
CHAT.globalIsInvite = false; CHAT.globalIsInvite = false;
...@@ -182,7 +167,7 @@ function setSocketAction () { ...@@ -182,7 +167,7 @@ function setSocketAction () {
// loadingIndicatorを表示しない // loadingIndicatorを表示しない
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}); });*/
// New Message // New Message
// #36170 // #36170
...@@ -254,12 +239,9 @@ function setSocketAction () { ...@@ -254,12 +239,9 @@ function setSocketAction () {
// #36147 // #36147
message.message = message.message.toString(); message.message = message.message.toString();
console.log(message.message);
//message.message.replaceAll('/acms',CHAT_SERVER_URL+"/acms");
var replacePath = message.message; var replacePath = message.message;
replacePath = replacePath.replaceAll('/acms',CHAT_SERVER_URL+'/acms'); replacePath = replacePath.replaceAll('/acms',CHAT_SERVER_URL+'/acms');
message.message = replacePath; message.message = replacePath;
console.log(message.message);
let html = Mustache.render(template, { let html = Mustache.render(template, {
text: message.message, text: message.message,
from: message.loginId, from: message.loginId,
...@@ -267,7 +249,6 @@ function setSocketAction () { ...@@ -267,7 +249,6 @@ function setSocketAction () {
createdAtDay: messageTime.createdAtDay, createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime createdAtTime: messageTime.createdAtTime
}); });
console.log(message.message);
html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html; html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
workVal = html + workVal; workVal = html + workVal;
}) })
......
/** /**
* Constant定義ファイル * Constant定義ファイル
*/ */
const readyState = { const readyState = {
UNINITIALIZED : 0 , UNINITIALIZED : 0 ,
LOADING : 1 , LOADING : 1 ,
...@@ -9,3 +8,11 @@ const readyState = { ...@@ -9,3 +8,11 @@ const readyState = {
INTERACTIVE : 3 , INTERACTIVE : 3 ,
COMPLETED : 4 COMPLETED : 4
} }
const messageType = {
TEXT : 0 ,
IMAGE : 1 ,
VIDEO : 2 ,
SYSTEM : 3 ,
COMMUNICATION : 4
}
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