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
0f021876
Commit
0f021876
authored
Feb 15, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
チャットルーム開設API連動
parent
de0375cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
3 deletions
+59
-3
public/js/chat-ui.js
+54
-2
public/js/chat-websocket.js
+5
-1
No files found.
public/js/chat-ui.js
View file @
0f021876
...
@@ -131,7 +131,11 @@ $('#room-search').on('input', function(event) {
...
@@ -131,7 +131,11 @@ $('#room-search').on('input', function(event) {
// 検索結果が有る場合、結果を表示する
// 検索結果が有る場合、結果を表示する
socket
.
emit
(
'roomSearch'
,
encodeURIComponent
(
$
(
'#room-search'
).
val
()));
socket
.
emit
(
'roomSearch'
,
encodeURIComponent
(
$
(
'#room-search'
).
val
()));
}
else
{
}
else
{
socket
.
emit
(
'getRoomList'
);
if
(
isOnline
==
'true'
)
{
android
.
updateRoomList
();
CHAT_UI
.
refreshRoomList
();
CHAT_UI
.
dismissLoadingIndicator
();
}
}
}
});
});
...
@@ -392,7 +396,11 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
...
@@ -392,7 +396,11 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
CHAT_UI
.
showLoadingIndicator
();
CHAT_UI
.
showLoadingIndicator
();
socket
.
emit
(
'leaveRoom'
,
function
()
{
socket
.
emit
(
'leaveRoom'
,
function
()
{
CHAT
.
saveRoomInfo
();
CHAT
.
saveRoomInfo
();
socket
.
emit
(
'getRoomList'
);
if
(
isOnline
==
'true'
)
{
android
.
updateRoomList
();
CHAT_UI
.
refreshRoomList
();
CHAT_UI
.
dismissLoadingIndicator
();
}
});
});
});
});
console
.
log
(
"show #pills-chat"
)
console
.
log
(
"show #pills-chat"
)
...
@@ -647,6 +655,10 @@ CHAT_UI.showConfirmView = function(isInvite) {
...
@@ -647,6 +655,10 @@ CHAT_UI.showConfirmView = function(isInvite) {
// ルーム名のURIencodingを行う
// ルーム名のURIencodingを行う
const
encodedRoomName
=
encodeURIComponent
(
newRoomName
);
const
encodedRoomName
=
encodeURIComponent
(
newRoomName
);
//todo android create room api
socket
.
emit
(
'createNewRoom'
,
userIdList
,
encodedRoomName
,
function
(
newRoomId
)
{
socket
.
emit
(
'createNewRoom'
,
userIdList
,
encodedRoomName
,
function
(
newRoomId
)
{
socket
.
emit
(
'joinRoom'
,
newRoomId
,
newRoomName
,
function
()
{
socket
.
emit
(
'joinRoom'
,
newRoomId
,
newRoomName
,
function
()
{
CHAT
.
saveRoomInfo
(
newRoomId
,
newRoomName
);
CHAT
.
saveRoomInfo
(
newRoomId
,
newRoomName
);
...
@@ -657,6 +669,46 @@ CHAT_UI.showConfirmView = function(isInvite) {
...
@@ -657,6 +669,46 @@ CHAT_UI.showConfirmView = function(isInvite) {
});
});
});
});
socket
.
on
(
'createNewRoom'
,
(
shopMemberIdList
,
newRoomName
,
callback
)
=>
{
const
user
=
onlineUsers
.
getUser
(
socket
.
id
)
if
(
user
){
var
loginIdListObj
=
new
Object
();
var
newRoomNameObj
=
new
Object
();
loginIdListObj
.
type
=
'loginIdList'
loginIdListObj
.
value
=
shopMemberIdList
newRoomNameObj
.
type
=
'newRoomName'
newRoomNameObj
.
value
=
newRoomName
var
path
=
httpRequest
.
makeChatRoomManageUrlPath
(
user
.
shopName
,
constant
.
ROOM_CREATENEWROOM
,
user
.
sid
,
loginIdListObj
,
newRoomNameObj
)
winston
.
info
(
'path'
+
path
)
httpRequest
.
readResult
(
path
,
(
res
)
=>
{
const
error
=
serverErrorHandler
(
res
)
if
(
error
.
errorFlag
)
{
winston
.
error
(
"Failed to [createNewRoom] process."
)
socket
.
emit
(
"showServerError"
,
error
.
errorMessage
);
return
;
}
winston
.
info
(
'create new room from server '
+
util
.
inspect
(
res
,
false
,
null
,
false
))
callback
(
res
.
roomId
)
// ユーザーリストをアップデートする
socket
.
emit
(
res
.
roomId
).
emit
(
'updateUserList'
,
res
.
userList
,
[
user
.
shop_member_id
])
})
}
else
{
socket
.
emit
(
"retryJoinProcess"
)
//join process
}
})
}
else
if
(
trimmedRoomName
.
includes
(
';'
)
||
trimmedRoomName
.
includes
(
'/'
)
||
trimmedRoomName
.
includes
(
'?'
)
||
trimmedRoomName
.
includes
(
':'
)
||
trimmedRoomName
.
includes
(
"@"
)
}
else
if
(
trimmedRoomName
.
includes
(
';'
)
||
trimmedRoomName
.
includes
(
'/'
)
||
trimmedRoomName
.
includes
(
'?'
)
||
trimmedRoomName
.
includes
(
':'
)
||
trimmedRoomName
.
includes
(
"@"
)
||
trimmedRoomName
.
includes
(
'&'
)
||
trimmedRoomName
.
includes
(
'='
)
||
trimmedRoomName
.
includes
(
"+"
)
||
trimmedRoomName
.
includes
(
'$'
)
||
trimmedRoomName
.
includes
(
","
)
||
trimmedRoomName
.
includes
(
'-'
)
||
trimmedRoomName
.
includes
(
'&'
)
||
trimmedRoomName
.
includes
(
'='
)
||
trimmedRoomName
.
includes
(
"+"
)
||
trimmedRoomName
.
includes
(
'$'
)
||
trimmedRoomName
.
includes
(
","
)
||
trimmedRoomName
.
includes
(
'-'
)
||
trimmedRoomName
.
includes
(
'_'
)
||
trimmedRoomName
.
includes
(
'.'
)
||
trimmedRoomName
.
includes
(
'!'
)
||
trimmedRoomName
.
includes
(
'~'
)
||
trimmedRoomName
.
includes
(
'*'
)
||
trimmedRoomName
.
includes
(
"
\
'"
)
||
trimmedRoomName
.
includes
(
'_'
)
||
trimmedRoomName
.
includes
(
'.'
)
||
trimmedRoomName
.
includes
(
'!'
)
||
trimmedRoomName
.
includes
(
'~'
)
||
trimmedRoomName
.
includes
(
'*'
)
||
trimmedRoomName
.
includes
(
"
\
'"
)
...
...
public/js/chat-websocket.js
View file @
0f021876
...
@@ -383,7 +383,11 @@ function setSocketAction () {
...
@@ -383,7 +383,11 @@ function setSocketAction () {
if
(
isInvite
)
{
if
(
isInvite
)
{
$
(
'#pills-chat-tab'
).
tab
(
'show'
);
$
(
'#pills-chat-tab'
).
tab
(
'show'
);
}
else
{
}
else
{
socket
.
emit
(
'getRoomList'
);
if
(
isOnline
==
'true'
)
{
android
.
updateRoomList
();
CHAT_UI
.
refreshRoomList
();
CHAT_UI
.
dismissLoadingIndicator
();
}
}
}
});
});
});
});
...
...
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