Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
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
abook_android
abook_check
Commits
5a32c06c
Commit
5a32c06c
authored
Apr 17, 2021
by
Lee Daehyun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'features/#577_ユーザ招待でメッセージを表示' into 'features/abcomm_sp6'
ユーザ招待で同じルームがあればポップアップを表示 See merge request
!121
parents
9f112e63
45177967
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
19 deletions
+77
-19
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+4
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/UserInviteResultJSON.java
+34
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+39
-17
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
5a32c06c
...
...
@@ -44,6 +44,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters
;
...
...
@@ -663,9 +664,10 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
boolean
inviteUsers
(
String
sid
,
Integer
roomId
,
String
roomName
,
String
userIds
)
throws
NetworkDisconnectedException
,
AcmsException
{
public
UserInviteResultJSON
inviteUsers
(
String
sid
,
Integer
roomId
,
String
roomName
,
String
userIds
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetUser
,
new
InviteUsersParameters
(
sid
,
AcmsApis
.
UserCmds
.
inviteUsers
,
roomId
,
roomName
,
userIds
));
return
response
.
httpResponseCode
==
200
;
UserInviteResultJSON
json
=
new
UserInviteResultJSON
(
response
.
httpResponseBody
);
return
json
;
}
/**
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/UserInviteResultJSON.java
0 → 100644
View file @
5a32c06c
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
;
import
org.json.adf.JSONArray
;
import
org.json.adf.JSONObject
;
import
java.util.ArrayList
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.JSONValidationException
;
import
jp.agentec.abook.abv.bl.dto.ShopMemberDto
;
public
class
UserInviteResultJSON
extends
AcmsCommonJSON
{
public
Integer
roomId
;
public
UserInviteResultJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
{
if
(!
json
.
has
(
ABookCommConstants
.
KEY
.
BODY
))
{
return
;
}
JSONObject
invateResultJson
=
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
);
if
(
invateResultJson
==
null
)
{
return
;
}
if
(
invateResultJson
.
has
(
ABookCommConstants
.
KEY
.
ROOM_ID
))
{
roomId
=
invateResultJson
.
getInt
(
ABookCommConstants
.
KEY
.
ROOM_ID
);
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
5a32c06c
...
...
@@ -61,6 +61,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.GroupListJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.MessageInfoListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.MyInfoJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
...
...
@@ -326,17 +327,30 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
// #36128
}
else
if
(
message
.
equals
(
"Do you want to delete this room?"
))
{
message
=
getString
(
R
.
string
.
msg_chat_confirm_delete
);
}
else
if
(
message
.
equals
(
"error_already_exist_same_user"
))
{
message
=
getString
(
R
.
string
.
msg_error_already_exist_same_room
);
}
else
{
message
=
"Confirm ?"
;
}
ABookAlertDialog
confirmAlert
=
AlertDialogUtil
.
createAlertDialog
(
ChatWebviewActivity
.
this
,
R
.
string
.
app_name
);
confirmAlert
.
setMessage
(
message
);
confirmAlert
.
setButton
(
DialogInterface
.
BUTTON_POSITIVE
,
getResources
().
getString
(
R
.
string
.
confirm
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
result
.
confirm
();
}
});
if
(
message
.
equals
(
getString
(
R
.
string
.
msg_error_already_exist_same_room
)))
{
confirmAlert
.
setButton
(
DialogInterface
.
BUTTON_POSITIVE
,
getResources
().
getString
(
R
.
string
.
move
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
result
.
confirm
();
}
});
}
else
{
confirmAlert
.
setButton
(
DialogInterface
.
BUTTON_POSITIVE
,
getResources
().
getString
(
R
.
string
.
confirm
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
result
.
confirm
();
}
});
}
confirmAlert
.
setButton
(
DialogInterface
.
BUTTON_NEGATIVE
,
getResources
().
getString
(
R
.
string
.
cancel
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
...
...
@@ -857,8 +871,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@JavascriptInterface
public
void
joinRoom
(
String
joinRoomId
,
String
joinRoomName
)
{
ChatRoomDto
chatRoom
=
communicationLogic
.
getChatRoom
(
Integer
.
parseInt
(
joinRoomId
));
roomId
=
Long
.
parseLong
(
joinRoomId
);
roomName
=
join
RoomName
;
roomId
=
chatRoom
.
chatRoomId
.
longValue
(
);
roomName
=
chatRoom
.
chat
RoomName
;
roomType
=
chatRoom
.
type
.
toString
();
beforeRoomType
=
chatRoom
.
type
.
toString
();
mChatWebView
.
post
(
new
Runnable
()
{
...
...
@@ -883,15 +897,23 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@JavascriptInterface
public
void
inviteUsers
(
String
userIds
)
throws
NetworkDisconnectedException
,
AcmsException
{
boolean
result
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
inviteUsers
(
sid
,
roomId
.
intValue
(),
roomName
,
userIds
);
if
(!
result
)
{
return
;
}
communicationLogic
.
addUserInRoom
(
userIds
,
roomId
.
intValue
());
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mChatWebView
.
loadUrl
(
CHAT_ROOM_PAGE_URL
);
}
});
final
UserInviteResultJSON
result
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
inviteUsers
(
sid
,
roomId
.
intValue
(),
roomName
,
userIds
);
if
(
result
.
roomId
==
null
)
{
communicationLogic
.
addUserInRoom
(
userIds
,
roomId
.
intValue
());
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mChatWebView
.
loadUrl
(
CHAT_ROOM_PAGE_URL
);
}
});
}
else
{
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mChatWebView
.
loadUrl
(
String
.
format
(
"javascript:CHAT_UI.displayExistRoom('%s');"
,
result
.
roomId
.
toString
()));
}
});
}
}
@JavascriptInterface
...
...
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