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
af6ab7c4
Commit
af6ab7c4
authored
Aug 03, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/add_user_in_collaboration
parents
3e3da3c4
c2726ba9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
23 deletions
+54
-23
public_new/js/sockets/chat-websocket-message.js
+4
-6
public_new/js/sockets/chat-websocket.js
+39
-13
public_new/js/views/collaboration/share-event-listener.js
+9
-3
public_new/js/views/collaboration/share.js
+2
-1
No files found.
public_new/js/sockets/chat-websocket-message.js
View file @
af6ab7c4
...
...
@@ -2,11 +2,11 @@ CHAT_SOCKET.bindOnNewMessage = function () {
// New Message
// #36170
socket
.
on
(
SOCKET_KEY
.
NEW_MESSAGE
,
function
(
message
,
roomID
,
roomName
)
{
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_MESSAGE
)
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_MESSAGE
)
;
});
socket
.
on
(
SOCKET_KEY
.
NEW_COMMUNICATION
,
function
(
message
,
roomID
,
roomName
)
{
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_COMMUNICATION
)
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_COMMUNICATION
)
;
});
};
...
...
@@ -26,9 +26,7 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) {
const
messageType
=
socketKey
;
const
messageText
=
unwrappedMessageInfo
;
if
(
messageType
==
SOCKET_KEY
.
NEW_COMMUNICATION
)
{
if
(
messageType
==
SOCKET_KEY
.
NEW_COMMUNICATION
)
{
CHAT_SOCKET
.
addCollaborationMessage
(
messageInfo
,
message
.
userId
,
...
...
@@ -48,7 +46,7 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) {
}
else
{
Common
.
dismissLoadingIndicator
();
}
}
}
;
CHAT_SOCKET
.
decodeMessage
=
function
(
text
)
{
try
{
...
...
public_new/js/sockets/chat-websocket.js
View file @
af6ab7c4
...
...
@@ -189,9 +189,9 @@ var bindOnRefreshUserListInGroup = function () {
};
var
nextFibonacci
=
function
(
num
)
{
let
nextNum
=
num
*
(
1
+
Math
.
sqrt
(
5
))
/
2.0
;
let
nextNum
=
(
num
*
(
1
+
Math
.
sqrt
(
5
)
))
/
2.0
;
return
Math
.
round
(
nextNum
);
}
}
;
CHAT_SOCKET
.
emitCreateMessage
=
function
(
socketKey
,
sendData
)
{
if
(
socket
.
connected
==
false
)
{
...
...
@@ -213,30 +213,56 @@ CHAT_SOCKET.emitCreateVideo = function (sendData) {
CHAT_SOCKET
.
emitCreateMessage
(
SOCKET_KEY
.
CREATE_VIDEO
,
sendData
);
};
CHAT_SOCKET
.
emitCreateCommunicationStart
=
function
(
sendData
,
collaborationType
,
meetingID
)
{
CHAT_SOCKET
.
emitCreateCommunicationStart
=
function
(
sendData
,
collaborationType
,
meetingID
)
{
if
(
socket
.
connected
==
false
)
{
CHAT_SOCKET
.
reconnectCreateMessage
(
SOCKET_KEY
.
COMMUNICATION
,
sendData
,
collaborationType
,
meetingID
);
CHAT_SOCKET
.
reconnectCreateMessage
(
SOCKET_KEY
.
COMMUNICATION
,
sendData
,
collaborationType
,
meetingID
);
}
else
{
socket
.
emit
(
SOCKET_KEY
.
COMMUNICATION
,
{
text
:
sendData
},
collaborationType
,
meetingID
);
socket
.
emit
(
SOCKET_KEY
.
COMMUNICATION
,
{
text
:
sendData
},
collaborationType
,
meetingID
);
}
};
CHAT_SOCKET
.
reconnectCreateMessage
=
function
(
socketKey
,
sendData
,
timeout
=
100
,
collaborationType
=
null
,
meetingID
=
null
)
{
CHAT_SOCKET
.
reconnectCreateMessage
=
function
(
socketKey
,
sendData
,
timeout
=
100
,
collaborationType
=
null
,
meetingID
=
null
)
{
if
(
socket
.
connected
==
false
)
{
console
.
log
(
"socket disconnected, reconnect... "
+
timeout
)
console
.
info
(
"socket disconnected, reconnect... "
+
timeout
);
CHAT_SOCKET
.
initialJoin
();
setTimeout
(
function
()
{
CHAT_SOCKET
.
reconnectCreateMessage
(
socketKey
,
sendData
,
nextFibonacci
(
timeout
));
setTimeout
(
function
()
{
CHAT_SOCKET
.
reconnectCreateMessage
(
socketKey
,
sendData
,
nextFibonacci
(
timeout
)
);
},
timeout
);
}
else
{
console
.
log
(
"reconnected"
)
return
;
}
console
.
info
(
"socket reconnected"
);
if
(
collaborationType
==
null
)
{
socket
.
emit
(
socketKey
,
{
text
:
sendData
});
}
else
{
socket
.
emit
(
socketKey
,
{
text
:
sendData
},
collaborationType
,
meetingID
);
}
}
}
};
CHAT_SOCKET
.
emitCollaborationFinishMessage
=
function
()
{
if
(
socket
!=
null
&&
socket
.
connected
)
{
...
...
public_new/js/views/collaboration/share-event-listener.js
View file @
af6ab7c4
...
...
@@ -211,14 +211,20 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
CollaborationFeature
.
didReceiveCreateRoomResponseMessage
=
function
()
{
let
coviewInviteMessage
=
""
;
let
collaborationType
=
CHAT_UTIL
.
getCollaborationTypeNumber
(
globalUserInfo
.
collaborationType
);
let
meetingID
=
null
let
collaborationType
=
CHAT_UTIL
.
getCollaborationTypeNumber
(
globalUserInfo
.
collaborationType
);
let
meetingID
=
null
;
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
)
{
meetingID
=
globalUserInfo
.
meetingID
;
}
CHAT_SOCKET
.
emitCreateCommunicationStart
(
coviewInviteMessage
,
collaborationType
,
meetingID
);
CHAT_SOCKET
.
emitCreateCommunicationStart
(
coviewInviteMessage
,
collaborationType
,
meetingID
);
};
CollaborationFeature
.
didReceivedJoinRoomInfoResponseMessage
=
function
()
{
...
...
public_new/js/views/collaboration/share.js
View file @
af6ab7c4
...
...
@@ -52,7 +52,8 @@ function changeCollaboration(collaborationType) {
case
COLLABORATION_TYPE
.
DOCUMENT
:
coview_api
.
ChangeCollaboration
(
"audio"
);
newMeetingID
=
NativeBridgeDataSource
.
createContentView
();
if
(
newMeetingID
==
"-1"
)
{
//会議室作成失敗
if
(
newMeetingID
==
"-1"
)
{
//会議室作成失敗
CoviewBridge
.
finishCollaboration
();
return
;
}
...
...
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