Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCommunication
chat_webview
Commits
9b995d74
Commit
9b995d74
authored
Jul 30, 2021
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_kim-ec' into 'develop'
# Conflicts: # public_new/js/sockets/chat-websocket-message.js
parents
f6859950
2be15710
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
35 deletions
+60
-35
public_new/js/common/common.js
+1
-1
public_new/js/common/constant.js
+5
-0
public_new/js/sockets/chat-websocket-message.js
+22
-15
public_new/js/sockets/chat-websocket.js
+19
-3
public_new/js/utils/chat-media-handler.js
+6
-6
public_new/js/views/chats/chat-room-message.js
+2
-2
public_new/js/views/collaboration/share-event-listener.js
+5
-8
No files found.
public_new/js/common/common.js
View file @
9b995d74
...
...
@@ -169,7 +169,7 @@ Common.startCollaboration = function (collaborationType) {
return
;
}
const
sendData
=
DATA_MESSAGE_SCHEME
+
FINISH_ALL_COLLABORATION_SIGNAL
;
CHAT_SOCKET
.
emitCreateMessage
(
sendData
,
0
);
CHAT_SOCKET
.
emitCreateMessage
(
SOCKET_KEY
.
CREATE_MESSAGE
,
sendData
);
NativeBridgeDelegate
.
finishAllCollaboration
();
}
NativeBridgeDelegate
.
startCollaboration
(
collaborationType
);
...
...
public_new/js/common/constant.js
View file @
9b995d74
...
...
@@ -131,6 +131,7 @@ const SOCKET_KEY = {
DISCONNECT
:
"disconnect"
,
CONNECT_ERROR
:
"connect_error"
,
NEW_MESSAGE
:
"newMessage"
,
NEW_COMMUNICATION
:
"newCommunication"
,
NEW_NOTIFICATION
:
"newNotification"
,
REFRESH_GROUPLIST
:
"refreshGroupList"
,
REFRESH_USERLIST_INGROUP
:
"refreshUserListInGroup"
,
...
...
@@ -138,6 +139,10 @@ const SOCKET_KEY = {
RETRY_JOIN_PROCESS
:
"retryJoinProcess"
,
JOIN
:
"join"
,
CREATE_MESSAGE
:
"createMessage"
,
CREATE_TEXT
:
"createText"
,
CREATE_IMAGE
:
"createImage"
,
CREATE_VIDEO
:
"createVideo"
,
CREATE_COMMUNICATIONSTART
:
"createCommunicationStart"
,
GET_GROUP_LIST
:
"getGroupList"
,
LEAVE_ROOM
:
"leaveRoom"
,
};
...
...
public_new/js/sockets/chat-websocket-message.js
View file @
9b995d74
...
...
@@ -2,27 +2,38 @@ CHAT_SOCKET.bindOnNewMessage = function () {
// New Message
// #36170
socket
.
on
(
SOCKET_KEY
.
NEW_MESSAGE
,
function
(
message
,
roomID
,
roomName
)
{
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_MESSAGE
)
});
socket
.
on
(
SOCKET_KEY
.
NEW_COMMUNICATION
,
function
(
message
,
roomID
,
roomName
)
{
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_COMMUNICATION
)
});
};
var
handleMessage
=
function
(
message
,
roomName
,
socketKey
)
{
const
systemMessageTemplate
=
getTemplate
(
TemplateURL
.
SYSTEM_MESSAGE
);
const
unwrappedMessageInfo
=
CHAT_SOCKET
.
decodeMessage
(
message
.
text
);
const
unwrappedMessageInfo
=
decodeMessage
(
message
.
text
);
if
(
unwrappedMessageInfo
==
DATA_MESSAGE_SCHEME
+
FINISH_ALL_COLLABORATION_SIGNAL
)
{
CHAT_SOCKET
.
cleanUpCollaborationMessage
();
cleanUpCollaborationMessage
();
return
;
}
if
(
unwrappedMessageInfo
.
includes
(
messageSeperator
))
{
const
messageInfo
=
unwrappedMessageInfo
.
split
(
messageSeperator
);
const
messageText
=
messageInfo
[
0
];
const
messageType
=
messageInfo
[
1
];
const
messageType
=
socketKey
;
let
messageText
=
unwrappedMessageInfo
;
if
(
unwrappedMessageInfo
.
includes
(
messageSeperator
))
{
messageText
=
messageInfo
[
0
];
}
if
(
messageType
==
MessageType
.
COMMUNICATIONSTART
||
messageType
==
MessageType
.
COMMUNICATIONEND
messageType
==
SOCKET_KEY
.
NEW_COMMUNICATION
)
{
CHAT_SOCKET
.
addCollaborationMessage
(
addCollaborationMessage
(
messageInfo
,
message
.
userId
,
roomName
,
...
...
@@ -30,8 +41,7 @@ CHAT_SOCKET.bindOnNewMessage = function () {
message
.
createdAt
);
}
else
{
CHAT_SOCKET
.
addTextMessage
(
messageText
,
message
,
socket
.
id
);
}
addTextMessage
(
messageText
,
message
,
socket
.
id
);
}
if
(
typeof
ChatRoom
!==
"undefined"
)
{
...
...
@@ -39,13 +49,10 @@ CHAT_SOCKET.bindOnNewMessage = function () {
setTimeout
(
function
()
{
ChatRoom
.
scrollToBottom
();
},
300
);
}
else
{
Common
.
dismissLoadingIndicator
();
}
});
};
}
CHAT_SOCKET
.
decodeMessage
=
function
(
text
)
{
var
decodeMessage
=
function
(
text
)
{
try
{
return
decodeURIComponent
(
text
);
}
catch
(
e
)
{
...
...
public_new/js/sockets/chat-websocket.js
View file @
9b995d74
...
...
@@ -188,14 +188,30 @@ var bindOnRefreshUserListInGroup = function () {
);
};
CHAT_SOCKET
.
emitCreateMessage
=
function
(
sendData
,
offset
)
{
socket
.
emit
(
SOCKET_KEY
.
CREATE_MESSAGE
,
{
text
:
sendData
},
offset
);
CHAT_SOCKET
.
emitCreateMessage
=
function
(
socketKey
,
sendData
)
{
socket
.
emit
(
socketKey
,
{
text
:
sendData
});
};
CHAT_SOCKET
.
emitCreateText
=
function
(
sendData
)
{
CHAT_SOCKET
.
emitCreateMessage
(
SOCKET_KEY
.
CREATE_TEXT
,
sendData
);
};
CHAT_SOCKET
.
emitCreateImage
=
function
(
sendData
)
{
CHAT_SOCKET
.
emitCreateMessage
(
SOCKET_KEY
.
CREATE_IMAGE
,
sendData
);
};
CHAT_SOCKET
.
emitCreateVideo
=
function
(
sendData
)
{
CHAT_SOCKET
.
emitCreateMessage
(
SOCKET_KEY
.
CREATE_VIDEO
,
sendData
);
};
CHAT_SOCKET
.
emitCreateCommunicationStart
=
function
(
sendData
,
collaborationType
,
meetingID
)
{
socket
.
emit
(
SOCKET_KEY
.
CREATE_COMMUNICATIONSTART
,
{
text
:
sendData
},
collaborationType
,
meetingID
);
};
CHAT_SOCKET
.
emitCollaborationFinishMessage
=
function
()
{
if
(
socket
!=
null
&&
socket
.
connected
)
{
const
sendData
=
DATA_MESSAGE_SCHEME
+
FINISH_ALL_COLLABORATION_SIGNAL
;
CHAT_SOCKET
.
emitCreateMessage
(
sendData
,
0
);
CHAT_SOCKET
.
emitCreateMessage
(
SOCKET_KEY
.
CREATE_MESSAGE
,
sendData
);
}
};
...
...
public_new/js/utils/chat-media-handler.js
View file @
9b995d74
...
...
@@ -168,8 +168,8 @@ ChatMediaHandler.videoEncodeEnd = function (encodedUri) {
}
catch
(
e
)
{
encodedText
=
text
;
}
const
sendData
=
encodedText
+
messageSeperator
+
MessageType
.
VIDEO
;
CHAT_SOCKET
.
emitCreate
Message
(
sendData
,
1
);
const
sendData
=
encodedText
;
CHAT_SOCKET
.
emitCreate
Video
(
sendData
);
$
(
".overlay"
).
removeClass
(
"active undismissable"
);
$
(
".loader"
).
removeClass
(
"active"
);
...
...
@@ -319,8 +319,8 @@ ChatMediaHandler.uploadImage = function (formData) {
}
catch
(
e
)
{
encodedText
=
text
;
}
const
sendData
=
encodedText
+
messageSeperator
+
MessageType
.
IMAGE
;
CHAT_SOCKET
.
emitCreate
Message
(
sendData
,
1
);
const
sendData
=
encodedText
;
CHAT_SOCKET
.
emitCreate
Image
(
sendData
);
}
else
{
// 動画の処理
if
(
res
.
thumbnailPath
&&
res
.
thumbnailPath
.
length
>
0
)
{
...
...
@@ -369,8 +369,8 @@ ChatMediaHandler.uploadImage = function (formData) {
}
catch
(
e
)
{
encodedText
=
text
;
}
const
sendData
=
encodedText
+
messageSeperator
+
MessageType
.
VIDEO
;
CHAT_SOCKET
.
emitCreate
Message
(
sendData
,
1
);
const
sendData
=
encodedText
;
CHAT_SOCKET
.
emitCreate
Video
(
sendData
);
}
$
(
".overlay"
).
removeClass
(
"active undismissable"
);
...
...
public_new/js/views/chats/chat-room-message.js
View file @
9b995d74
...
...
@@ -65,8 +65,8 @@ ChatRoom.sendMessage = function (e) {
messageTextBox
.
val
(
""
);
if
(
message
.
length
>
0
)
{
const
sendData
=
message
+
messageSeperator
+
MessageType
.
TEXT
;
CHAT_SOCKET
.
emitCreate
Message
(
sendData
,
0
);
const
sendData
=
message
;
CHAT_SOCKET
.
emitCreate
Text
(
sendData
);
}
$
(
".message_input_form"
).
focus
();
};
...
...
public_new/js/views/collaboration/share-event-listener.js
View file @
9b995d74
...
...
@@ -206,18 +206,15 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
};
CollaborationFeature
.
didReceiveCreateRoomResponseMessage
=
function
()
{
let
coviewInviteMessage
=
""
+
messageSeperator
+
MessageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationTypeNumber
(
globalUserInfo
.
collaborationType
);
let
coviewInviteMessage
=
""
;
let
collaborationType
=
CHAT_UTIL
.
getCollaborationTypeNumber
(
globalUserInfo
.
collaborationType
);
let
meetingID
=
null
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
)
{
coviewInviteMessage
+=
messageSeperator
+
globalUserInfo
.
meetingID
;
meetingID
=
globalUserInfo
.
meetingID
;
}
CHAT_SOCKET
.
emitCreate
Message
(
coviewInviteMessage
,
0
);
CHAT_SOCKET
.
emitCreate
CommunicationStart
(
coviewInviteMessage
,
collaborationType
,
meetingID
);
};
CollaborationFeature
.
didReceivedJoinRoomInfoResponseMessage
=
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment