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
b4c29715
Commit
b4c29715
authored
Aug 06, 2021
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#43695 ウェブソケットの送信方式変更
parent
38cd9254
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
public_new/js/sockets/chat-websocket-message.js
+8
-13
public_new/js/views/chats/chat-room-message.js
+1
-1
No files found.
public_new/js/sockets/chat-websocket-message.js
View file @
b4c29715
CHAT_SOCKET
.
bindOnNewMessage
=
function
()
{
CHAT_SOCKET
.
bindOnNewMessage
=
function
()
{
// New Message
// New Message
// #36170
// #36170
socket
.
on
(
SOCKET_KEY
.
NEW_MESSAGE
,
function
(
message
,
roomID
,
roomName
,
onlineUsers
)
{
socket
.
on
(
SOCKET_KEY
.
NEW_MESSAGE
,
function
(
message
,
roomID
,
roomName
)
{
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_MESSAGE
,
roomID
,
onlineUsers
);
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_MESSAGE
);
});
});
socket
.
on
(
SOCKET_KEY
.
NEW_COMMUNICATION
,
function
(
message
,
roomID
,
roomName
,
collaborationType
,
meetingID
)
{
socket
.
on
(
SOCKET_KEY
.
NEW_COMMUNICATION
,
function
(
message
,
roomID
,
roomName
,
collaborationType
,
meetingID
)
{
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_COMMUNICATION
,
null
,
null
,
collaborationType
,
meetingID
);
CHAT_SOCKET
.
handleMessage
(
message
,
roomName
,
SOCKET_KEY
.
NEW_COMMUNICATION
,
collaborationType
,
meetingID
);
});
});
};
};
CHAT_SOCKET
.
handleMessage
=
function
(
message
,
roomName
,
socketKey
,
roomID
=
null
,
onlineUsers
=
null
,
collaborationType
=
null
,
meetingID
=
null
)
{
CHAT_SOCKET
.
handleMessage
=
function
(
message
,
roomName
,
socketKey
,
collaborationType
=
null
,
meetingID
=
null
)
{
const
systemMessageTemplate
=
getTemplate
(
TemplateURL
.
SYSTEM_MESSAGE
);
const
systemMessageTemplate
=
getTemplate
(
TemplateURL
.
SYSTEM_MESSAGE
);
const
unwrappedMessageInfo
=
CHAT_SOCKET
.
decodeMessage
(
message
.
text
);
const
unwrappedMessageInfo
=
CHAT_SOCKET
.
decodeMessage
(
message
.
text
);
...
@@ -41,7 +41,7 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey, roomID = nul
...
@@ -41,7 +41,7 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey, roomID = nul
meetingID
meetingID
);
);
}
else
{
}
else
{
CHAT_SOCKET
.
addTextMessage
(
messageText
,
message
,
socket
.
id
,
roomID
,
onlineUsers
);
CHAT_SOCKET
.
addTextMessage
(
messageText
,
message
,
socket
.
id
);
}
}
if
(
typeof
ChatRoom
!==
"undefined"
)
{
if
(
typeof
ChatRoom
!==
"undefined"
)
{
...
@@ -132,7 +132,7 @@ CHAT_SOCKET.renderCollaborationMessage = function (
...
@@ -132,7 +132,7 @@ CHAT_SOCKET.renderCollaborationMessage = function (
});
});
};
};
CHAT_SOCKET
.
addTextMessage
=
function
(
messageText
,
message
,
socketID
,
roomID
,
onlineUsers
)
{
CHAT_SOCKET
.
addTextMessage
=
function
(
messageText
,
message
,
socketID
)
{
const
messageTextWithSID
=
CHAT_SOCKET
.
insertSID
(
messageText
);
const
messageTextWithSID
=
CHAT_SOCKET
.
insertSID
(
messageText
);
const
messageSender
=
JSON
.
parse
(
const
messageSender
=
JSON
.
parse
(
NativeBridgeDataSource
.
getUserInfoList
(
message
.
userId
)
NativeBridgeDataSource
.
getUserInfoList
(
message
.
userId
)
...
@@ -142,16 +142,13 @@ CHAT_SOCKET.addTextMessage = function (messageText, message, socketID, roomID, o
...
@@ -142,16 +142,13 @@ CHAT_SOCKET.addTextMessage = function (messageText, message, socketID, roomID, o
message
.
id
===
socketID
message
.
id
===
socketID
);
);
const
profileImagePath
=
Common
.
getProfileImgUrl
(
message
.
profileImagePath
);
const
profileImagePath
=
Common
.
getProfileImgUrl
(
message
.
profileImagePath
);
const
users
=
NativeBridgeDataSource
.
getUsersInRoom
(
roomID
);
const
unreadCount
=
users
.
length
-
(
onlineUsers
.
users
.
length
-
1
);
const
html
=
CHAT_SOCKET
.
renderTextMessage
(
const
html
=
CHAT_SOCKET
.
renderTextMessage
(
textMessageTemplate
,
textMessageTemplate
,
messageTextWithSID
,
messageTextWithSID
,
shopMemberName
,
shopMemberName
,
profileImagePath
,
profileImagePath
,
message
.
userId
,
message
.
userId
,
message
.
createdAt
,
message
.
createdAt
unreadCount
);
);
$
(
"#messages"
).
prepend
(
html
);
$
(
"#messages"
).
prepend
(
html
);
};
};
...
@@ -162,8 +159,7 @@ CHAT_SOCKET.renderTextMessage = function (
...
@@ -162,8 +159,7 @@ CHAT_SOCKET.renderTextMessage = function (
from
,
from
,
profileImagePath
,
profileImagePath
,
userID
,
userID
,
createdAt
,
createdAt
unreadCount
)
{
)
{
let
messageTime
=
CHAT_UTIL
.
formatDate
(
createdAt
);
let
messageTime
=
CHAT_UTIL
.
formatDate
(
createdAt
);
let
dataInsertedTemplate
=
Mustache
.
render
(
template
,
{
let
dataInsertedTemplate
=
Mustache
.
render
(
template
,
{
...
@@ -175,7 +171,6 @@ CHAT_SOCKET.renderTextMessage = function (
...
@@ -175,7 +171,6 @@ CHAT_SOCKET.renderTextMessage = function (
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
,
createdAtTime
:
messageTime
.
createdAtTime
,
isToday
:
true
,
isToday
:
true
,
unreadCount
:
unreadCount
,
});
});
// イメージの場合、img tagを追加する
// イメージの場合、img tagを追加する
...
...
public_new/js/views/chats/chat-room-message.js
View file @
b4c29715
...
@@ -96,7 +96,7 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
...
@@ -96,7 +96,7 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
// メッセージ表示
// メッセージ表示
let
messages
=
NativeBridgeDataSource
.
getMessagesByRoomID
(
roomID
);
let
messages
=
NativeBridgeDataSource
.
getMessagesByRoomID
(
roomID
);
ChatRoom
.
prependMessage
(
messages
,
roomID
);
ChatRoom
.
prependMessage
(
messages
);
CHAT_SOCKET
.
cleanUpCollaborationMessage
(
true
);
CHAT_SOCKET
.
cleanUpCollaborationMessage
(
true
);
...
...
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