Commit 00d90361 by Lee Munkyeong

getLoginParameter修正。

parent 540a5369
......@@ -79,6 +79,20 @@ public class CommunicationLogic extends AbstractLogic {
return roomListToStr;
}
public String getUsersInRoom(Integer roomId) {
List<ShopMemberDto> userList = shopMemberDao.getUserInRoom(roomId);
JSONArray attendUsers = new JSONArray();
for (ShopMemberDto user : userList) {
Map<String, Object> userMap = new HashMap<String, Object>();
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, user.shopMemberId);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, user.profileUrl);
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, user.shopMemberName);
JSONObject jsonObject = new JSONObject(userMap);
attendUsers.put(jsonObject);
}
String attendUsersStr = attendUsers.toString();
return attendUsersStr;
}
public String getMessages(Integer roomId) {
List<ChatMessageDto> chatMessageDtoList = chatMessageDao.getChatMessage(roomId);
......
......@@ -85,6 +85,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public_new/chat.html";
//private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public/networkError.html";
private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
private final String DEFAULT_CHECKSUM = "0000000000";
//AISDevelop
......@@ -539,12 +541,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
// 最後のチャットのルーム
PreferenceUtil.putUserPref(getApplicationContext(), AppDefType.UserPrefKey.CHAT_LAST_ROOMID, String.valueOf(roomId));
mChatWebView.loadUrl(String.format("javascript:getLoginParameter('%s', '%s', '%s', '%s', '%s', '%s');", sid, loginId, shopName, roomId, roomName, localLanguage));
mChatWebView.loadUrl(String.format("javascript:getLoginParameter('%s', '%s', '%s', '%s', '%s', '%s', '%s');", sid, loginId, shopName, roomId, roomName, localLanguage, shopMemberId));
} else {
if (lastRoomName.length() > 0 && lastRoomId.length() > 0) {
mChatWebView.loadUrl(String.format("javascript:getLoginParameter('%s', '%s', '%s', '%s', '%s', '%s');", sid, loginId, shopName, lastRoomId, lastRoomName, localLanguage));
mChatWebView.loadUrl(String.format("javascript:getLoginParameter('%s', '%s', '%s', '%s', '%s', '%s', '%s');", sid, loginId, shopName, lastRoomId, lastRoomName, localLanguage, shopMemberId));
} else {
mChatWebView.loadUrl(String.format("javascript:getLoginParameter('%s', '%s', '%s', undefined, undefined, '%s');", sid, loginId, shopName, localLanguage));
mChatWebView.loadUrl(String.format("javascript:getLoginParameter('%s', '%s', '%s', undefined, undefined, '%s', '%s');", sid, loginId, shopName, localLanguage, shopMemberId));
}
}
}
......@@ -767,12 +769,31 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public void joinRoom(String joinRoomId, String joinRoomName) {
roomId = Long.parseLong(joinRoomId);
roomName = joinRoomName;
System.out.println("-----------joinROOM ON android-------"+roomId+"-"+roomName);
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(CHAT_ROOM_PAGE_URL);
}
});
}
@JavascriptInterface
public String getMyInfo() {
String myInfoStr = communicationLogic.getMyInfo();
return myInfoStr;
}
@JavascriptInterface
public String getUsersInRoom(String roomId) {
String attendUsers = communicationLogic.getUsersInRoom(Integer.parseInt(roomId));
return attendUsers;
}
@JavascriptInterface
public String getMyGroupUsers() {
String myGroupUsersStr = communicationLogic.getMyGroupUsers();
return myGroupUsersStr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment