Commit 881f5653 by Lee Munkyeong

Merge branch 'communication/develop' of…

Merge branch 'communication/develop' of https://gitlab.agentec.jp/abook_android/abook_check into communication/develop
parents 0732e5bd 02aed716
......@@ -69,6 +69,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
Integer insertId = 0;
Integer messageType = 0;
Integer messageId = 0;
String roomType = "";
Log.d(TAG,"tempMsg : "+ tempMsg);
......@@ -97,6 +98,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
if (pushMsg.contains(INVITE_COLLABORATION)) {
roomType = Integer.toString(json.getInt("roomType"));
String[] inviteMessage = pushMsg.split("<::split>");
tempMsg = getString(R.string.msg_invite_collaboration);
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
......@@ -107,6 +109,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); // sendLoginId
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, inviteMessage[1]);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
startActivity(pushMsgDialog);
return;
}
......
......@@ -115,7 +115,9 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this, getRString(R.string.app_name), getIntent().getExtras().getString(PushMessageKey.message));
Bundle extras = getIntent().getExtras();
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
if (roomId != 0) {
if (roomId == 0) {
alertDialog.setPositiveButton(R.string.ok, null);
} else {
alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
......@@ -127,25 +129,26 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
long pushSendDate = extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
List<PushMessageDto> pushMessageDtoList = AbstractLogic.getLogic(PushMessageLogic.class).getAllPushMessageList();
Logger.d("pushSendDate","pushSendDate : " + pushSendDate);
Logger.d("pushSendDate", "pushSendDate : " + pushSendDate);
String pushSendDateDate = DateTimeUtil.toString(new Date(pushSendDate), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("pushSendDate","pushSendDateDate : " + pushSendDateDate);
Logger.d("pushSendDate", "pushSendDateDate : " + pushSendDateDate);
String pushSendDateDate2 = DateTimeUtil.toString(DateTimeUtil.toDate(pushSendDateDate, DateTimeFormat.yyyyMMddHHmmssSSS_none), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("pushSendDate","pushSendDateDate2 : " + pushSendDateDate2);
Logger.d("pushSendDate", "pushSendDateDate2 : " + pushSendDateDate2);
for (int i=0; i < pushMessageDtoList.size() - 1; i++) {
for (int i = 0; i < pushMessageDtoList.size() - 1; i++) {
String tempDate = DateTimeUtil.toString(pushMessageDtoList.get(i).pushSendDate, DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("tempDate","date : " + tempDate);
Logger.d("tempDate", "date : " + tempDate);
}
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName);
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType);
}
}
}
......@@ -159,8 +162,6 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
finish();
}
});
} else {
alertDialog.setPositiveButton(R.string.ok, null);
}
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
......
......@@ -144,5 +144,6 @@ public interface AppDefType {
String pushSendLoginId = "pushSendLoginId";
String pushSendDate = "pushSendDate";
String collaborationType = "collaborationType";
String roomType = "roomType";
}
}
......@@ -163,6 +163,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private int mCollaborationType;
private int mHostRequestFlg = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -188,6 +191,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
sid = intent.getStringExtra("sid");
roomId = intent.getLongExtra("roomId", 0);
roomName = intent.getStringExtra("roomName");
roomType = intent.getStringExtra("roomType");
loginId = intent.getStringExtra("loginId");
shopName = intent.getStringExtra("shopName");
collaborationType = intent.getStringExtra("collaborationType");
......@@ -286,7 +290,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
e.printStackTrace();
}
Integer integerRoomId = Integer.parseInt(roomId.toString());
if (StringUtil.isNullOrEmpty(roomType)) {
roomType = communicationLogic.getChatRoom(integerRoomId).type.toString();
}
if (StringUtil.isNullOrEmpty(collaborationType)) {
String parameterData = "sid=" + sid + "&loginId=" + loginId + "&shopName=" + shopName + "&roomId=" + roomId + "&roomName=" + roomName + fixedParam;
mChatWebView.postUrl(CHAT_ROOM_PAGE_URL, parameterData.getBytes());
......@@ -426,6 +432,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
message = getString(R.string.msg_error_already_exist_same_room);
} else if (message.equals("방장 권한을 전달 받으시겠습니까?")){
message = getString(R.string.msg_confirm_send_host_change);
if (mHostRequestFlg == 1) {
mChatWebView.loadUrl("javascript:penOff();");
mChatWebView.loadUrl("javascript:$('#hostRequestModal').modal('hide');");
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');");
result.confirm();
return true;
}
} else if (message.equals("캡쳐한 사진을 공유 하시겠습니까?")) {
message = getString(R.string.msg_confirm_share_image);
}
......@@ -1583,6 +1596,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
encodedVideo.delete();
}
}
@JavascriptInterface
public void setHostRequestFlg(int hostRequestFlg) {
mHostRequestFlg = hostRequestFlg;
}
@JavascriptInterface
public int getHostRequestFlg() {
return mHostRequestFlg;
}
}
/**
......
......@@ -1926,7 +1926,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
this.previousOfSettingActivity2 = activity;
}
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType) {
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType) {
String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent();
......@@ -1940,7 +1940,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra("shopName", shopName);
intent.putExtra("roomId", roomId);
intent.putExtra("roomName", roomName);
intent.putExtra("roomType", roomType);
intent.setClassName(mContext.getPackageName(), className);
Activity activity2 = null;
......
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