Commit 7ffcdc67 by Kang Donghun

Merge branch 'release_sp3_start_collaboration_message' into 'release_sp3'

Release sp3 start collaboration message

See merge request !114
parents 060b7c8c 911e6d38
......@@ -175,6 +175,11 @@ function setSocketAction () {
, function(text) {
systemMessageTemplate = text;
});
var openCollaborationMessageTemplate;
$.get({ url: "./template/template_open_collaboration_message.html", async: false }
, function(text) {
openCollaborationMessageTemplate = text;
});
let template = userMessageTemplate;
if (message.id === socket.id) {
......@@ -188,13 +193,42 @@ function setSocketAction () {
} catch(e) {
message.text = message.text
}
let messageType;
let collaborationType;
if ( message.text.includes(messageSeperator) ) {
message.text = message.text.split(messageSeperator)[0];
let text = message.text.split(messageSeperator);
message.text = text[0];
messageType = text[1];
if (messageType == messageType.COMMUNICATIONSTART || messageType == messageType.COMMUNICATIONEND) {
collaborationType = text[2];
var userInCollaboration;
if (CHAT_UTIL.isIOS()) {
userInCollaboration = JSON.parse(CHAT_DB.getUserInfoList(message.userId));
} else if (CHAT_UTIL.isAndroid()) {
userInCollaboration = JSON.parse(android.getUserInfoList(message.userId));
}
userInCollaboration.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
})
template = openCollaborationMessageTemplate;
let html = Mustache.render(template, {
roomName: roomName,
userCount: 1,
userList: userInCollaboration,
insertDate: message.insertDate,
collaborationType: collaborationType,
isToday: true,
createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime,
isOtherYear: false
});
$('#messages').append(html);
} else {
var replacePath = message.text;
replacePath = replacePath.replaceAll('?fileName=', '?sid=' + CHAT.globalLoginParameter.sid + '&fileName=');
message.text = replacePath;
//TODO newMessageの際にDB格納が必要。
let html = Mustache.render(template, {
text: message.text,
from: message.from,
......@@ -207,6 +241,8 @@ function setSocketAction () {
// イメージの場合、img tagを追加する
html = message.text.includes('attachedImages') || message.text.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
$('#messages').append(html);
}
}
// 画像、動画の描画を待ってからスクロール
setTimeout(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